0

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
1
  • you can create a batch file which either takes input from user or you can give him set of possible inputs to choose from Commented Jun 13, 2016 at 10:32

1 Answer 1

1

You can use option --:

npm run install -- --param differentOutput
answered Jun 13, 2016 at 10:40
Sign up to request clarification or add additional context in comments.

3 Comments

@patentul I do not understand your additional question. Explain.
How do I modify the "install": "browserify api-client.js -o ../www/components/global/api-client.js" part afterwards?
I mean I want to have the hardcoded value if a param is not added via the CLI

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.