Node.js: Use command-line arguments

/ Published in: JavaScript
Save to your folder(s)

Copy this code and paste it in your HTML
  1. // run with node myFile.js arg1 arg2
  2. process.argv[2]; // will be 'arg1'
  3. process.argv[3]; // will be 'arg2'

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.