basickarl
basickarl

Reputation: 40484

npm run-script myScript arguments

According to the website https://docs.npmjs.com/cli/run-script

npm run-script <command> [-- <args>...] 

Where can I find a list of these arguments?

Upvotes: 0

Views: 78

Answers (1)

KeatsPeeks
KeatsPeeks

Reputation: 19337

It just means that everything after the -- is passed directly to the invoked script. There is no fixed list of arguments, you define them yourself.

Example :

// Package.json :
"myscript": "node ./myfile.js"

// myfile.js :
console.log(process.argv[2]); 

// Command :    
npm run-script myscript -- foobar // prints 'foobar'

Upvotes: 1

Related Questions