homedir
method of OS
module of node.js
This method is used to get the home directory of the current user.
This method returns String
. Code snippet is given below :
//Name of the file: homedir.js
var os = require('os');
var value = os.homedir();
console.log("os.homedir() => " + value);
>node homedir.js
os.homedir() => C:\Users\acer