
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
getpwuid() for Node.js - returns username, name, home directory, shell, gid from
uid
If you're creating a reusable module you should probably use passwd-user instead, as it shells out rather than using a native binding.
$ npm install --save pwuid
This is a native binding and expects you to have the required toolchain. (ignore the node-gyp install)
getpwuid() is a POSIX function and won't work on Windows.
Use optionalDependencies if you need to include it in a cross-platform environment.
var pwuid = require('pwuid');
console.log(pwuid());
/*
{
name: 'sindresorhus',
uid: 501,
gid: 20,
gecos: 'Sindre Sorhus',
dir: '/Users/sindresorhus',
shell: '/bin/zsh'
}
*/
Accepts a uid number and returns an object with:
name: usernameuid: user ID, same as suppliedgid: group IDgecos: user information, usually the users full namedir: home directoryshell: default shellWill use current user process.getuid() if no uid is supplied.
MIT © Sindre Sorhus
FAQs
getpwuid() binding - returns username, name, home directory, shell, gid from uid
The npm package pwuid receives a total of 14 weekly downloads. As such, pwuid popularity was classified as not popular.
We found that pwuid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.