Node.js Path Module – Notes with Use Cases 💡 The path module in Node.js provides utilities to work with file and directory paths. It is built-in and can be imported using: const path = require('path'); ✅ path.basename(path) Returns: The filename from a full path. Use Case: Extract file name during file upload logging. path.basename('C:\\temp\\abcd.html'); // Output: 'abcd.html' ✅ path.dirname(path) Returns: The directory portion of the path. Use Case: Get parent directory before saving a file. path.dirname('foo\\abcd\\test.html'); // Output: 'foo\\abcd' ✅ path.extname(path) Returns: The file extension from the path. Use Case: Validate file type before processing upload. path.extname('test.html'); // '.html' path.extname('file.name.md'); // '.md' path.extname('.hiddenfile.txt'); // '.txt' path.extnam...