Installations
npm install passwd-user
Developer
sindresorhus
Developer Guide
Module System
ESM
Min. Node Version
^12.20.0 || ^14.13.1 || >=16.0.0
Typescript Support
Yes
Node Version
12.22.1
NPM Version
8.1.0
Statistics
27 Stars
41 Commits
6 Forks
6 Watching
1 Branches
5 Contributors
Updated on 28 Nov 2024
Languages
JavaScript (80.29%)
TypeScript (19.71%)
Total Downloads
Cumulative downloads
Total Downloads
43,444,723
Last day
-16.9%
44,413
Compared to previous day
Last week
-0.4%
263,866
Compared to previous week
Last month
27.2%
1,143,028
Compared to previous month
Last year
54.1%
9,079,725
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
passwd-user
Get the passwd user entry from a username or user identifier (UID)
Works on macOS and Linux. See user-info
if you need cross-platform support.
Install
1npm install passwd-user
Usage
1import {passwdUser} from 'passwd-user'; 2 3console.log(await passwdUser('sindresorhus')); 4/* 5{ 6 username: 'sindresorhus', 7 password: '*', 8 userIdentifier: 501, 9 groupIdentifier: 20, 10 fullName: 'Sindre Sorhus', 11 homeDirectory: '/home/sindresorhus', 12 shell: '/bin/zsh' 13} 14*/ 15 16await passwdUser(501); 17console.log('Got entry for user 501'); 18 19const user = await passwdUser(); 20console.log(`Got entry for user ${user.userIdentifier}`);
API
Returns an object with:
username
password
userIdentifier
: UIDgroupIdentifier
: GIDfullName
: Name of userhomeDirectory
: Home directoryshell
: Default shell
passwdUser(username?)
passwdUser(userIdentifier?)
Returns a Promise<object>
with the user entry.
passwdUserSync(username?)
passwdUserSync(userIdentifier?)
Returns an object
with the user entry.
username
Type: string
The username to look up.
userIdentifier
Type: number
Default: process.getuid()
(The current user)
The user identifier (UID) to look up.
Related
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
Found 3/27 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/passwd-user/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/passwd-user/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:25
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 6 are checked with a SAST tool
Score
4.2
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More