This package is no longer relevant as Node.js 4 is unmaintained.
Node.js
os.userInfo()
ponyfill
$ npm install --save user-info
const userInfo = require('user-info');
console.log(userInfo());
/*
{
uid: 501,
gid: 20,
username: 'sindresorhus',
homedir: '/Users/sindresorhus',
shell: '/bin/zsh'
}
*/
See the os.userInfo()
docs.
The encoding
option is not supported.
MIT © Sindre Sorhus