Skip to content

Instantly share code, notes, and snippets.

@furusin
Created September 2, 2016 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save furusin/f09810857915b4dd921ccf13567cfc6d to your computer and use it in GitHub Desktop.
Save furusin/f09810857915b4dd921ccf13567cfc6d to your computer and use it in GitHub Desktop.
Node.jsでコマンドライン引数を取得する ref: http://qiita.com/furusin_oriver/items/f030d1eaa9e7b54233c3
argv[0] = node
argv[1] = /workspace/test.js
argv[2] = aaa
argv[3] = bbb
argv[4] = ccc
argv[5] = ddd
argv[6] = eee
for(var i = 0;i < process.argv.length; i++){
console.log("argv[" + i + "] = " + process.argv[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment