Subject: Scripts calling scripts
Author: WebSpider
In response to: Custom scripts
Posted on: 04/22/2021 10:15:30 PM
package.json:
...
"scripts": {
"start": "node index.js",
"hello": "echo 'Hello World!'"
"calling-hello": "npm run hello",
}
...
C:\tmp\npm-scripts\hello>npm run calling-hello
> hello@1.0.0 calling-hello C:\tmp\npm-scripts\hello
> npm run hello
> hello@1.0.0 hello C:\tmp\npm-scripts\hello
> echo 'Hello World!'
'Hello World!'
>
> On 04/22/2021 10:11:14 PM
WebSpider wrote:
package.json:
...
"scripts": {
"start": "node index.js",
"hello": "echo 'Hello World!'"
}
...
NOTE: The custom scripts must be executed by adding run like:
C:\tmp\npm-scripts\hello>npm run hello
> hello@1.0.0 hello C:\tmp\npm-scripts\hello
> echo 'Hello World!'
'Hello World!'
References: