Get user info of a npm user
Since npm has no API for this we're forced to scrape the profile page.
Use the faster npm-email if you only need the email.
$ npm install --save npm-user
const npmUser = require('npm-user');
npmUser('sindresorhus').then(user => {
console.log(user);
/*
{
name: 'Sindre Sorhus',
email: 'sindresorhus@gmail.com',
homepage: 'http://sindresorhus.com',
github: 'sindresorhus',
twitter: 'sindresorhus',
freenode: 'sindresorhus'
}
*/
});
Values will be null
if they're not set in the npm profile.
- npm-user-cli - CLI for this module
- npm-email - Get the email of a npm user
- npm-keyword - Get a list of npm packages with a certain keyword
- package-json - Get the package.json of a package from the npm registry
MIT © Sindre Sorhus