node.js - Accessing arguments sent via npm run-script -


i run command:

npm run a_script --oki="odo" 

how value of oki in script? i'd use example: if(process.argv.oki === 'odo').

i tried:

console.log(process.argv); 

it doesn't show there.

i read https://docs.npmjs.com/cli/run-script , doesn't give example.

you have insert 2 dashes between script name , argument list npm pass them script.

e.g. npm run a_script -- --oki="odo"


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -