일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Github
- Binding
- mysql
- convert
- programmers
- tls
- windows10
- 코딩테스트
- WPF
- nullable
- ListView
- git
- logging
- windows
- Process
- .net
- Microsoft
- chashtag
- IValueConverter
- log
- coding-test
- dotNET
- Visual Studio
- csharp
- C#
- algorithm
- Coding
- commit
- File
- string
Archives
- Today
- Total
목록arguments (1)
CHashtag

안녕하세요. 오늘은 Node.js를 Command Line으로 실행할 때 그 뒤에 인자를 전달하는 방법에 대해 알아보도록 하겠습니다. 아래의 명령을 CMD에서 입력하였을 때 Hello와 Hi를 출력하는 프로그램을 만들어 보도록 하겠습니다. node Index.js Hello Hi Node.js 공식 문서에 의하면, 별도의 라이브러리 없이 process.argv를 사용하면 가능하다고 합니다. (nodejs.org/docs/latest/api/process.html#process_process_argv) 이해를 돕기위해 간단한 예제를 보여드리도록 하겠습니다. // Index.js process.argv.forEach((val, index) => { console.log(`${index}: ${val}`); ..
Node.js
2021. 3. 13. 18:31