Skip to content

Instantly share code, notes, and snippets.

@hidsh
Created January 24, 2022 16:26
Show Gist options
  • Save hidsh/a42b27d779bbb59c23e1cdbdc26f7a6c to your computer and use it in GitHub Desktop.
Save hidsh/a42b27d779bbb59c23e1cdbdc26f7a6c to your computer and use it in GitHub Desktop.
nodeではargs[2]が最初の引数になる。
console.log(`arg length: ${process.argv.length}\n`);
for(let i=0; i<process.argv.length; i++){
console.log(`argv[${i}]: ${process.argv[i]}`);
}
console.log('\n※ nodeではargs[2]が最初の引数になる。');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment