username.sync
yarn add username-sync
npm install username-sync --save
var username = require('username-sync');
username() // => "best-guess-system-username"
If you are using new versions of node => 4x, please use username module. This project exists to help users make the transition.