Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/npm-user
Get user info of an npm user
https://github.com/sindresorhus/npm-user
Last synced: about 1 month ago
JSON representation
Get user info of an npm user
- Host: GitHub
- URL: https://github.com/sindresorhus/npm-user
- Owner: sindresorhus
- License: mit
- Created: 2015-05-16T18:50:02.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-02-28T20:01:07.000Z (8 months ago)
- Last Synced: 2024-04-14T10:28:45.011Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 57
- Watchers: 8
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-npm - npm-user - Get user info of an npm user. (Packages / Registry)
- awesome-npm - npm-user - Get user info of an npm user. (Packages / Registry)
README
# npm-user
> Get user info of an npm user
Since npm has no API for this, we are forced to scrape the [profile page](https://www.npmjs.com/~sindresorhus).
*Use the faster [npm-email](https://github.com/sindresorhus/npm-email) package if you only need the email.*
## Install
```sh
npm install npm-user
```## Usage
```js
import npmUser from 'npm-user';console.log(await npmUser('sindresorhus'));
/*
{
name: 'Sindre Sorhus',
avatar: 'https://www.npmjs.com/npm-avatar/…',
email: '[email protected]',
github: 'sindresorhus',
twitter: 'sindresorhus'
}
*/
```*The values will be `undefined` if they're not set in the npm profile.*
## Related
- [npm-user-cli](https://github.com/sindresorhus/npm-user-cli) - CLI for this module
- [npm-email](https://github.com/sindresorhus/npm-email) - Get the email of an npm user
- [npm-keyword](https://github.com/sindresorhus/npm-keyword) - Get a list of npm packages with a certain keyword
- [package-json](https://github.com/sindresorhus/package-json) - Get the package.json of a package from the npm registry