luca.p.alexandru
luca.p.alexandru

Reputation: 1750

npm pass command line argument to command

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

Upvotes: 0

Views: 75

Answers (1)

stdob--
stdob--

Reputation: 29172

You can use option --:

npm run install -- --param differentOutput

Upvotes: 1

Related Questions