From 307b3bd9f90e96fcc8805a1d5ddec80787a3d3a7 Mon Sep 17 00:00:00 2001 From: Michael Garvin Date: Fri, 8 Jan 2021 10:37:34 -0800 Subject: [PATCH] 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 --- docs/content/commands/npm-stop.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/content/commands/npm-stop.md b/docs/content/commands/npm-stop.md index 17156c97c404..9e8f9be360fd 100644 --- a/docs/content/commands/npm-stop.md +++ b/docs/content/commands/npm-stop.md @@ -12,7 +12,31 @@ npm stop [-- ] ### 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