Socket
Socket
Sign inDemoInstall

getpw

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    getpw

node.js wrapper for POSIX getpwuid() function


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Changes

  • 1.0.0 - updated to use node-gyp and modern V8 API

FAQs

Last updated on 04 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc