All fields

“File System (fs) Module” in Information Technology

14 questions across 1 technology.

Information Technology

14 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is the difference between fs.rename() and manually copying then deleting a file, particularly across different filesystems or drives? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleIntermediate
2How do you safely watch a directory or file for changes using fs.watch(), and what are its known cross-platform limitations? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleIntermediate
3What is the difference between the synchronous, callback-based, and promise-based variants of Node's fs module methods? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleBeginner
4How would you read a large file efficiently using a stream rather than loading it entirely into memory with fs.readFile()? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleIntermediate
5What are Node.js file descriptor limits, and how might a Node.js application unintentionally exhaust them? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleAdvanced
6What does the node:path module provide, and why should you always use it instead of manually concatenating file path strings? Node.js › Core Node.js ModulesNode.jsCore Node.js ModulesIntermediate
7What is the node: prefix for core module imports, and why was it introduced? Node.js › Core Node.js ModulesNode.jsCore Node.js ModulesBeginner
8What does path.parse() and path.format() do, and how are they useful for decomposing and reconstructing file paths? Node.js › Path & OS ModulesNode.jsPath & OS ModulesBeginner
9What is the security risk of trusting a client-supplied filename for an uploaded file, and how do you mitigate it? Node.js › File Uploads & Media ProcessingNode.jsFile Uploads & Media ProcessingAdvanced
10What is the difference between path.join() and path.resolve(), and when would you use each? Node.js › Path & OS ModulesNode.jsPath & OS ModulesBeginner
11How would you validate an uploaded image's actual dimensions and reject ones that don't meet minimum or maximum size requirements? Node.js › File Uploads & Media ProcessingNode.jsFile Uploads & Media ProcessingIntermediate
12What does 'non-blocking I/O' mean, and how does a Node.js function like fs.readFile() achieve it compared to fs.readFileSync()? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
13What is the difference between synchronous and asynchronous versions of the same core Node.js API, using fs.readFile vs fs.readFileSync as an example, and when is the synchronous version actually appropriate? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
14How 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