1NPM-SET-SCRIPT(1)                                            NPM-SET-SCRIPT(1)
2
3
4

NAME

6       npm-set-script - Set tasks in the scripts section of package.json
7
8   Synopsis
9       An  npm  command  that lets you create a task in the scripts section of
10       the package.json.
11
12         npm set-script [<script>] [<command>]
13
14       Example:
15
16npm set-script start "http-server ."
17
18
19         {
20           "name": "my-project",
21           "scripts": {
22             "start": "http-server .",
23             "test": "some existing value"
24           }
25         }
26
27   Configuration
28       <!-- AUTOGENERATED CONFIG DESCRIPTIONS  START  -->  <!--  automatically
29       generated,  do  not edit manually --> <!-- see lib/utils/config/defini‐
30       tions.js -->
31
32   workspace
33       • Default:
34
35       • Type: String (can be set multiple times)
36
37
38       Enable running a command in the context of the configured workspaces of
39       the  current project while filtering by running only the workspaces de‐
40       fined by this configuration option.
41
42       Valid values for the workspace config are either:
43
44       • Workspace names
45
46       • Path to a workspace directory
47
48       • Path to a parent workspace directory (will result to selecting all of
49         the nested workspaces)
50
51
52       When  set  for the npm init command, this may be set to the folder of a
53       workspace which does not yet exist, to create the folder and set it  up
54       as a brand new workspace within the project.
55
56       This  value  is  not  exported  to the environment for child processes.
57       <!-- automatically  generated,  do  not  edit  manually  -->  <!--  see
58       lib/utils/config/definitions.js -->
59
60
61   workspaces
62       • Default: false
63
64       • Type: Boolean
65
66
67       Enable  running  a  command  in  the  context  of  all  the  configured
68       workspaces.
69
70       This value is not exported to  the  environment  for  child  processes.
71       <!--  automatically  generated,  do  not  edit  manually  -->  <!-- see
72       lib/utils/config/definitions.js -->
73
74       <!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
75
76
77   See Also
78       • npm help run-script
79
80       • npm help install
81
82       • npm help test
83
84       • npm help start
85
86
87
88
89                                 October 2021                NPM-SET-SCRIPT(1)
Impressum