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

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

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

asp.net - Problems sending emails from forum -