- Core compatibility with
npm run-script <command> [-- <args>...]
- Define scripts using JavaScript in
scripts.js
- Use plain-old JavaScript function references as scripts
- Minimal unit tests
-
Extends EventEmitter, which can be used like so:
const Runner = require('run-simple') const runner = new Runner() runner.on('error', (error) => { console.error(error) process.exit(1) }) runner.on('exit', (code) => { process.exit(code) }) runner.on('list', (scripts) => { Object.keys(scripts).forEach((name) => console.log(` ${name}:\n ${scripts[name]}`)) process.exit() }) runner.on('run', (spec) => { console.log() console.log(`> ${spec.name}${spec.version ? `@${spec.version}` : ''} ${spec.cwd}`) console.log(`> ${spec.script}`) console.log() }) runner.run()
-
Includes
@${version}
specified inpackage.json
in script preambles
- Split module into
runner.js
- Update docs and scripts accordingly
- Drop plans for hooks scripts and prepending node path
- Fall back to a default
start
script if and only ifserver.js
exists - Check that
<command>
does not begin withpre
orpost
before prefixing
- Use
spawn()
to run shell scripts andfork()
to run JS functions - Move
runner.js
intolib
directory
- Implement
--version
,--help
, and--quiet
(with--silent
alias)
- Use
spawnSync()
to run shell scripts - Use
new Script().runInThisContext()
to run JS functions - Remove
'signal'
event type
- Close over
scripts.js
functions - Emit error event when package directory can’t be accessed
- Return early if the package directory or both
package.json
andscripts.js
can’t be accessed - Trim
env.npm_package_gitHead
- Handle promise return values from
scripts.js
functions - Elide
scripts.js
function source code with[Function]
in list output - Write
watchtest()
script - Rethrow a wider range of module import errors