get current path nodejs

129

get current path nodejs -

console.log("Current directory:", __dirname);
//OR
console.log("Current directory:", process.cwd());
//OR
const path = require("path");

const directoryName = path.basename(__dirname);
console.log(directoryName); 

Comments

Submit
0 Comments