diff options
author | Yash-Singh1 <saiansh2525@gmail.com> | 2020-11-25 01:24:24 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2020-12-04 22:22:59 +0300 |
commit | 6b15751106beb99234aa4bf39ae05cf40076d42a (patch) | |
tree | 5c224bef8de7a145bf184005fe7b51175f1dc938 /docs | |
parent | bc655b17e841eabc67a66c236dfb0aa9ca0317f1 (diff) |
feat: add npm set-script
Introduces the set-script command. It accepts two arguments,
the script name and the command
ref: https://github.com/npm/rfcs/blob/latest/accepted/0016-set-script-command.md
PR-URL: https://github.com/npm/cli/pull/2237
Credit: @Yash-Singh1
Close: #2237
Reviewed-by: @ruyadorno
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/commands/npm-set-script.md | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/content/commands/npm-set-script.md b/docs/content/commands/npm-set-script.md new file mode 100644 index 000000000..7bc8f75d2 --- /dev/null +++ b/docs/content/commands/npm-set-script.md @@ -0,0 +1,34 @@ +--- +title: npm-set-script +section: 1 +description: Set tasks in the scripts section of package.json +--- + +### Synopsis +An npm command that lets you create a task in the scripts section of the package.json. + +```bash +npm set-script [<script>] [<command>] +``` + + +**Example:** + +* `npm set-script start "http-server ."` + +```json +{ + "name": "my-project", + "scripts": { + "start": "http-server .", + "test": "some existing value" + } +} +``` + +### See Also + +* [npm run-script](/commands/npm-run-script) +* [npm install](/commands/npm-install) +* [npm test](/commands/npm-test) +* [npm start](/commands/npm-start) |