Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

npm-user

sindresorhus33.3kMIT6.1.1TypeScript support: included

Get user info of an npm user

npm, user, username, homepage, email, get, website, scrape, info, profile

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.

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

Install

npm install npm-user

Usage

import npmUser from 'npm-user';

console.log(await npmUser('sindresorhus'));
/*
{
    name: 'Sindre Sorhus',
    avatar: 'https://www.npmjs.com/npm-avatar/…',
    email: 'sindresorhus@gmail.com',
    github: 'sindresorhus',
    twitter: 'sindresorhus'
}
*/

The values will be undefined if they're not set in the npm profile.