go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Scripts calling scripts
 
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:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.