Saturday, September 5, 2020

Script directory,file path and file name with global object

 

global.console.log("kjkjk")
console.log(__dirname)//global object default so can be ignored
console.log(__filename)

require('path');
var path = require('path');
console.log(__dirname)
console.log(path.basename(__dirname))

No comments:

Post a Comment