29 questions for “CLI Tools & Scripting with Node.js”

Found in 1 field. Select a question to see its full answer.

Information Technology

29 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is a shebang line, and why does it need to be the first line of an executable Node.js CLI script? Node.js › CLI Tools & Scripting with Node.jsNode.jsCLI Tools & Scripting with Node.jsBeginner
2How would you parse command-line arguments and flags in a Node.js CLI tool using a library like commander or yargs? Node.js › CLI Tools & Scripting with Node.jsNode.jsCLI Tools & Scripting with Node.jsIntermediate
3How do you correctly set an exit code from a Node.js CLI script to signal success or failure to the calling shell or CI pipeline? Node.js › CLI Tools & Scripting with Node.jsNode.jsCLI Tools & Scripting with Node.jsIntermediate
4How do you write cross-platform shell scripts in Node.js that work identically on Windows, macOS, and Linux? Node.js › CLI Tools & Scripting with Node.jsNode.jsCLI Tools & Scripting with Node.jsIntermediate
5How would you build an interactive CLI wizard that prompts the user for multiple pieces of input using a library like Inquirer.js? Node.js › CLI Tools & Scripting with Node.jsNode.jsCLI Tools & Scripting with Node.jsAdvanced
6What is the difference between require() (CommonJS) and import (ES Modules) when loading Node.js's own core modules? Node.js › Core Node.js ModulesNode.jsCore Node.js ModulesBeginner
7How does Node.js's built-in test runner (node:test) compare to third-party frameworks like Jest or Mocha? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
8What are Node.js Single Executable Applications (SEA), and what are their current limitations? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
9How would you recursively read all files within a directory tree in Node.js? Node.js › File System & File ProcessingNode.jsFile System & File ProcessingIntermediate
10How would you implement a directory-size calculator in Node.js that recursively sums the size of all files within a directory tree? Node.js › File System & File ProcessingNode.jsFile System & File ProcessingAdvanced