1.0.0 • Published 7 years ago

add-npm-scripts v1.0.0

Weekly downloads
1,667
License
ISC
Repository
github
Last release
7 years ago

add-npm-scripts

add npm scripts to your package.json from CLI
boring version of npm-add-script

Install

npm install -g add-npm-scripts

Usage

Run the command from any directory with a package.json file. The command takes 3 parameters:

  • the script name
  • the script body
  • an optional -w or --warn flag

The default behaviour is to overwrite a script if it currently exists. The -w flag will warn the user that they're about to overwrite an existing script and will require a (y/n) confirmation.

$ add-npm-scripts <name> <body> [-w|--warn]

eg.

$ add-npm-scripts start "node server.js"
$ npm start
> node server.js

Listening at http://localhost:3000/