run-npm-script

1.0.3 • Public • Published

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));

Readme

Keywords

Package Sidebar

Install

npm i run-npm-script

Weekly Downloads

1

Version

1.0.3

License

WTFPL

Last publish

Collaborators

  • austinmatherne