diff options
| author | 8cy <[email protected]> | 2020-04-03 02:37:42 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-03 02:37:42 -0700 |
| commit | 60867fb030bae582082340ead7dbc7efdc2f5398 (patch) | |
| tree | 4c6a7356351be2e4914e15c4703172597c45656e /node_modules/spawn-sync/README.md | |
| parent | commenting (diff) | |
| download | s5nical-60867fb030bae582082340ead7dbc7efdc2f5398.tar.xz s5nical-60867fb030bae582082340ead7dbc7efdc2f5398.zip | |
2020/04/03, 02:34, v1.2.0
Diffstat (limited to 'node_modules/spawn-sync/README.md')
| -rw-r--r-- | node_modules/spawn-sync/README.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/node_modules/spawn-sync/README.md b/node_modules/spawn-sync/README.md new file mode 100644 index 0000000..ada990d --- /dev/null +++ b/node_modules/spawn-sync/README.md @@ -0,0 +1,53 @@ +# spawn-sync + +Polyfill for `child_process.spawnSync`. + +On iojs and node >= 0.12 it will just export the built in `child_process.spawnSync`. On platforms that support compiling native modules it uses the [thread-sleep](https://github.com/ForbesLindesay/thread-sleep) module to wait for an output file to exist in a tight loop. In this way it gains excellent cross platform support, but don't expect it to be efficient on all platforms. + +[](https://travis-ci.org/ForbesLindesay/spawn-sync) +[](https://david-dm.org/ForbesLindesay/spawn-sync) +[](https://www.npmjs.com/package/spawn-sync) + +## Installation + + npm install spawn-sync + +If this fails, you can try one of the following things: + +1. Some package managers made a stupid decision to rename the `node` executable to `nodejs` for their platform. This breaks compatibility with lots of modules. If you normally use `nodejs` instead of `node`, you should check out http://stackoverflow.com/questions/18130164/nodejs-vs-node-on-ubuntu-12-04 for possible fixes. + +2. You can install using `--unsafe-perm`, which will fix any permissions issues. + + npm install --unsafe-perm spawn-sync + +3. You can install using `--ignore-scripts`, which will skip native compilation. You'll get a warning if you try to require the module, but everything should still work. + + npm install --ignore-scripts spawn-sync + +4. You can try [updating npm](https://docs.npmjs.com/getting-started/installing-node), since this seems to fail on some older versions of npm: + + sudo npm install npm -g + +5. You can upgrade to the latest version of node or iojs. This will make native compilation unnecessary. You can then use `--ignore-scripts` without getting a warning if you still have trouble. + +## Usage + +```js +var spawnSync = require('spawn-sync'); + +var result = spawnSync('node', + ['filename.js'], + {input: 'write this to stdin'}); + +if (result.status !== 0) { + process.stderr.write(result.stderr); + process.exit(result.status); +} else { + process.stdout.write(result.stdout); + process.stderr.write(result.stderr); +} +``` + +## License + + MIT |