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

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
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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.