A util for just running a npm script
-
- 3.1. npmExec(name, argsForScript, pkgdata, wd, cb)
- 3.1.1. input
- 3.1.2. argsForScript
- 3.1.3. pkgdata
- 3.1.4. wd
- 3.1.5. cb
- 3.1. npmExec(name, argsForScript, pkgdata, wd, cb)
$ npm install --save standalone-npm-exec
const npmExec = require('npm-exec');
npmExec(script, args, pkgdata, wd, function (er) {
if (er) {
// Something bad happened
}
// Yay!
});
Type: string
The script name to execute. Can either be a script defined in pkgdata
or the name of a file in wd/node_modules/.bin
.
Type: Array<string>
Any args for the script you are running.
Type: Object
The parsed package.json
data for where the script should be executed.
Type: path
The working directory of where to find executables and where to execute the scripts.
Type: function(err)
The function to be called when it is done.
$ npm install --global npm-exec
$ npm-exec --help
Usage
npm-exec [name] [args...]
Arguments
name: Name of script to run or executable
If not provided, npm-exec will prompt you to give it a name
args: Arguments for the script [Default: None]
Examples
$ npm-exec
$ npm-exec test
$ npm-exec eslint *.js
MIT © legodude17