Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
node.js wrapper for POSIX getpwuid() function
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
getpw.cc
package.json
test.js
wscript

README.md

getpw Build Status

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
Something went wrong with that request. Please try again.