diff options
author | Michael Garvin <gar+gh@danger.computer> | 2021-01-08 21:37:34 +0300 |
---|---|---|
committer | Michael Garvin <gar+gh@danger.computer> | 2021-01-15 00:16:15 +0300 |
commit | 307b3bd9f90e96fcc8805a1d5ddec80787a3d3a7 (patch) | |
tree | f210d882a22a0f610a6e2059372d5c6c2fb157b5 /docs | |
parent | 7dd0dfc59c861e7d3e30a86a8e6db10872fc6b44 (diff) |
fix(docs): clean up `npm stop` docs
Adds an example and outlines differences with `npm start`
PR-URL: https://github.com/npm/cli/pull/2460
Credit: @wraithgar
Close: #2460
Reviewed-by: @darcyclarke
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/commands/npm-stop.md | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/docs/content/commands/npm-stop.md b/docs/content/commands/npm-stop.md index 17156c97c..9e8f9be36 100644 --- a/docs/content/commands/npm-stop.md +++ b/docs/content/commands/npm-stop.md @@ -12,7 +12,31 @@ npm stop [-- <args>] ### Description -This runs a package's "stop" script, if one was provided. +This runs a predefined command specified in the "stop" property of a +package's "scripts" object. + +Unlike with [npm start](/commands/npm-start), there is no default script +that will run if the `"stop"` property is not defined. + +### Example + +```json +{ + "scripts": { + "stop": "node bar.js" + } +} +``` + +```bash +npm stop + +> npm@x.x.x stop +> node bar.js + +(bar.js output would be here) + +``` ### See Also |