I have in my npm package the following scripts property:
"scripts": {
"test": "jasmine-node spec/",
"install": "browserify api-client.js -o ../www/components/global/api-client.js"
}
How can I do something like
npm run install --param differentOutput
so as not to hardcode the '../www/components/global/api-client.js' path
a1626
2,9641 gold badge22 silver badges34 bronze badges
asked Jun 13, 2016 at 10:25
luca.p.alexandru
1,7706 gold badges24 silver badges47 bronze badges
-
you can create a batch file which either takes input from user or you can give him set of possible inputs to choose froma1626– a16262016年06月13日 10:32:17 +00:00Commented Jun 13, 2016 at 10:32
1 Answer 1
You can use option --:
npm run install -- --param differentOutput
answered Jun 13, 2016 at 10:40
stdob--
29.2k6 gold badges62 silver badges77 bronze badges
Sign up to request clarification or add additional context in comments.
3 Comments
stdob--
@patentul I do not understand your additional question. Explain.
luca.p.alexandru
How do I modify the "install": "browserify api-client.js -o ../www/components/global/api-client.js" part afterwards?
luca.p.alexandru
I mean I want to have the hardcoded value if a param is not added via the CLI
lang-js