Created
September 2, 2016 06:11
-
-
Save furusin/f09810857915b4dd921ccf13567cfc6d to your computer and use it in GitHub Desktop.
Node.jsでコマンドライン引数を取得する ref: http://qiita.com/furusin_oriver/items/f030d1eaa9e7b54233c3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
argv[0] = node | |
argv[1] = /workspace/test.js | |
argv[2] = aaa | |
argv[3] = bbb | |
argv[4] = ccc | |
argv[5] = ddd | |
argv[6] = eee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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