Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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); 
Source by sebhastian.com #
 
PREVIOUS NEXT
Tagged: #current #path #nodejs
ADD COMMENT
Topic
Name
3+8 =