File tree Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,39 @@ npm start [-- <args>]
1212
1313### Description
1414
15- This runs an arbitrary command specified in the package's ` "start" ` property of
16- its ` "scripts" ` object. If no ` "start" ` property is specified on the
17- ` "scripts" ` object, it will run ` node server.js ` .
15+ This runs an predefined command specified in the ` "start" ` property of
16+ a package's ` "scripts" ` object.
17+
18+ If no ` "start" ` property is specified on the ` "scripts" ` object, it
19+ will run ` node server.js ` .
20+
21+ Note that this is different than the default node behavior of running
22+ the file specified in a package's ` "main" ` attribute when evoking with
23+ ` node . `
1824
1925As of
[ ` [email protected] ` ] ( https://blog.npmjs.org/post/98131109725/npm-2-0-0 ) , you can
2026use custom arguments when executing scripts. Refer to [ ` npm run-script ` ] ( /commands/npm-run-script ) for more details.
2127
28+ ### Example
29+
30+ ``` json
31+ {
32+ "scripts" : {
33+ "start" : " node foo.js"
34+ }
35+ }
36+ ```
37+
38+ ``` bash
39+ npm start
40+
41+ 42+ > node foo.js
43+
44+ (server.js output would be here)
45+
46+ ```
47+
2248### See Also
2349
2450* [ npm run-script] ( /commands/npm-run-script )
You can’t perform that action at this time.
0 commit comments