The path module in Node.js is used to work with file and directory paths.
const path = require("path");
const filePath = "/students/projects/index.html";
console.log("File name:", path.basename(filePath));
console.log("Extension:", path.extname(filePath));
console.log("Directory:", path.dirname(filePath));