npm.io
4.1.1 • Published 7 years ago

@pkgstats/npm-user

Licence
MIT
Version
4.1.1
Deps
3
Size
5 kB
Vulns
1
Weekly
0
Stars
58

npm-user Build Status

Get user info of an npm user

Since npm has no API for this we're forced to scrape the profile page.

Use the faster npm-email package if you only need the email.

Install

$ npm install npm-user

Usage

const npmUser = require('npm-user');

(async () => {
	console.log(await npmUser('sindresorhus'));
	/*
	{
		name: 'Sindre Sorhus',
		avatar: 'https://gravatar.com/avatar/d36a92237c75c5337c17b60d90686bf9?size=496',
		email: 'sindresorhus@gmail.com',
		github: 'sindresorhus',
		twitter: 'sindresorhus'
	}
	*/
})();

Values will be null if they're not set in the npm profile.

License

MIT Sindre Sorhus

Keywords