Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node execute js file with parameters

// print process.argv
process.argv.forEach(function (val, index, array) {
  console.log(index + ': ' + val);
});

//This will generate:

$ node process-2.js one two=three four

0: node
1: /Users/mjr/work/node/process-2.js
2: one
3: two=three
4: four
 
PREVIOUS NEXT
Tagged: #node #execute #js #file #parameters
ADD COMMENT
Topic
Name
8+9 =