I am new to Node.js. Recently, I am building a script as below:
"updateData": "node runFirstScript.js && node runSecondScript.js",
"build:desktop": "npm run updateData env1",
"build:mobile": "npm run updateData env2",
I am expecting runFirstScript.js and runSecondScript.js can get the parameters env1
and env2
while they are executed.
Instead of separating as below:
"updateData1": "node runFirstScript.js",
"updateData2": "node runFirstScript.js",
"build:desktop": "npm run updateData1 env1 && npm run updateData2 env1",
"build:mobile": "npm run updateData1 env2 && npm run updateData2 env2",
Is there any optimum solution for this? Thanks