package
NPM run-script spawning options generator
npm install npm-scriptGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Generate spawn options for running package.json scripts
Emulates npm run-script $SCRIPT_NAME
**NOTE: ** Does not add in the log wrapping like NPM
var lifecycle = process.argv[2];
getNPMSpawnOptions(process.cwd(), lifecycle, {
defaultScript: {
start: 'node server.js',
preinstall: '[ -f wscript] && (node-waf clean || true; node-waf configure build)'
}[lifecycle],
env: {
PATH: process.env.PATH
},
fs?: fs_api // defaults to require('fs') used for remote system stuff
}, function (err, spawnOptions) {
var script = require('child_process').spawn.apply(null, spawnOptions);
script.stderr.pipe(process.stderr);
script.stdout.pipe(process.stdout);
script.on('exit', process.exit.bind(process));
});npm run-scripts start (use options.defaultScript)suspawnnpm help scripts