getpw

node.js wrapper for POSIX getpwuid() function

npm install getpw
1 downloads in the last week
3 downloads in the last month

getpw

node.js wrapper for POSIX {getpwuid()} function. The main use of this method is to convert numeric user ids (e.g. as obtainable from {process.getuid()}) into string user names.

For more info

man getpwuid

Install

npm install getpw

or

git clone http://github.com/femto113/node-getpw.git
cd getpw
npm link

Example

var getpw = require("getpw");

console.log(getpw.getpwuid(process.getuid())

outputs something like

{ pw_name: 'femto113', pw_uid: 113, pw_gid: 22, pw_dir: '/home/femto113', pw_shell: '/bin/tcsh' }

TODO

  • will probably blow up on non-POSIX (i.e. Windows) OS
  • there are some other functions (esp. {getpwnam()}) that would make sense to add
npm loves you