isaacs/npm — Issue #1999: Restart script always runs stop and start
Author: laggyluke
Created: 2012-01-06 00:49:06+00:00
State: open

As per `npm help scripts`:

Note: npm restart will run the stop and start scripts if no restart script is provided.

But in reality this `package.json`:

{
"name": "example",
"version": "0.0.1",
"scripts": {
"start": "echo 'start'",
"stop": "echo 'stop'",
"restart": "echo 'restart'"
}
}

results in this behavior:

$ node -v
v0.6.6
$ npm -v
1.1.0-beta-4
$ npm restart

> example@0.0.1 stop /tmp/example
> echo 'stop'

stop

> example@0.0.1 restart /tmp/example
> echo 'restart'

restart

> example@0.0.1 start /tmp/example
> echo 'start'

start