Node.js TutorialLesson 6Free preview
Node Cmd Line
This lesson is part of Node.js · All levels
Summary
Node.js provides a number of command lines to control how the script is executed, such as directly evaluating code, enabling watch mode, or opening a debugger. Understanding this flag makes debugging and development workflows much faster. Additional arguments after the file name can be read from within the script via process.argv.
Key points
- Node -e 'code' executes code directly without a file
- Node --watch file.js re-run the script when the file changes
- Node inspector opens the built-in debugger for stepping code
- Additional arguments after the file name can be read by process.argv
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.