Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/madarche/npm-run-posix-or-windows
Portable NPM scripts when those have to work on Windows too
https://github.com/madarche/npm-run-posix-or-windows
Last synced: 2 months ago
JSON representation
Portable NPM scripts when those have to work on Windows too
- Host: GitHub
- URL: https://github.com/madarche/npm-run-posix-or-windows
- Owner: madarche
- License: mit
- Created: 2016-03-22T14:01:34.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T18:06:15.000Z (about 5 years ago)
- Last Synced: 2024-10-15T16:35:22.890Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
npm-run-posix-or-windows
========================[![NPM version](http://img.shields.io/npm/v/npm-run-posix-or-windows.svg)](https://www.npmjs.org/package/npm-run-posix-or-windows)
[![Dependency Status](https://david-dm.org/madarche/npm-run-posix-or-windows.svg)](https://david-dm.org/madarche/npm-run-posix-or-windows)
[![devDependency Status](https://david-dm.org/madarche/npm-run-posix-or-windows/dev-status.svg)](https://david-dm.org/madarche/npm-run-posix-or-windows#info=devDependencies)
[![Build Status](https://travis-ci.org/madarche/npm-run-posix-or-windows.svg?branch=master)](https://travis-ci.org/madarche/npm-run-posix-or-windows)This is a very lightweight and straightforward module that proposes a simple,
yet limited, solution to write portable NPM scripts when those have to work on
Windows too (the hell with Windows, hopefully someday all developers will be
working on Unix).Use `npm-run-posix-or-windows` in NPM `scripts` to run an alternative script
when the script is run under Windows. When under Windows the script name is then
suffixed with `:windows`.Usage:
```json
{
"name": "some-package-name",
"version": "1.0.0",
"author": "SomeOne",
"scripts": {
"postinstall": "npm prune && npm-run-posix-or-windows postinstall:leveldown",
"postinstall:leveldown": "cd node_modules/pouchdb/node_modules/leveldown && node-gyp rebuild --target=$npm_package_dependencies_electron_prebuilt --dist-url=https://atom.io/download/atom-shell",
"postinstall:leveldown:windows": "cd node_modules/pouchdb/node_modules/leveldown && node-gyp rebuild --target=%npm_package_dependencies_electron_prebuilt% --dist-url=https://atom.io/download/atom-shell",
"start": "electron ."
},
"dependencies": {
"bluebird": "3.3.3",
"electron-prebuilt": "0.36.7",
"npm-run-posix-or-windows": "2.0.0",
"pouchdb": "5.2.1"
}
}
```