‘__dirname’
returns the directory name of the current module.
HelloWorld.js
console.log("HelloWorld.js
fiel is located at %s", __dirname);
console.log("HelloWorld.js
file absolute path %s",__filename);
Output
HelloWorld.js
fiel is located at C:\Users\krishna\Documents\nodejs\examples
HelloWorld.js file absolute
pathC:\Users\krishna\Documents\nodejs\examples\HelloWorld.js
No comments:
Post a Comment