DEV Community

Discussion on: Pass arguments from the command line to a Node script

Collapse
 
markkoenig95 profile image
MarkKoenig95

Update:

node app.js name=flavio

const args = require('minimist')(process.argv.slice(2))
args['name'] //flavio

This won't work. It has to be passed in this way

node app.js --name=flavio

Then minimist will parse it correctly