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
Post a Comment