1.0.3 • Published 7 years ago
run-npm-script v1.0.3
Run NPM Script
Small utility to run npm scripts from node wrapped in a promise.
Why?
A number of reasons, but primarily to allow migrating away from task runners such as grunt or gulp, while retaining support for CI/CD which still call task runners.
Usage
const { npmTask, runNpmScript } = require('run-npm-script');
gulp.task('test', done => npmTask(['test'], done));
// or for more control handle the promise yourself
gulp.task('build', done => runNpmScript(['run', 'build']).then(done).catch(process.exit));