Giter Site home page Giter Site logo

npm-user's Introduction

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: '[email protected]',
	github: 'sindresorhus',
	twitter: 'sindresorhus'
}
*/

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

Related

npm-user's People

Contributors

0xch4z avatar bendingbender avatar dmnsgn avatar elena-p avatar kevva avatar ntwb avatar richienb avatar ryanhefner avatar sindresorhus avatar tbozhikov avatar tommy-mitchell avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

npm-user's Issues

Only email and Avatar are available

I think npm made some changes on the UI, now we can't get the twitter, github, freenode and name. If there is no other way to get this information then the package might be deprecated.

Upgrade npm-email to latest version to prevent Error

Issue

Running the package currently throws because the version of npm-email is ^3.2.1 which uses the now deprecated cnpmjs endpoint and not the more recent npms.io.

Error: User myUserName doesn't exist
    at npmEmail (/Users/path/to/node_modules/npm-email/index.js:25:10)

Solution

It will need update to 4.0.1 but since it is now ESM, do you want to upgrade this package to ESM as well (in which case no problem) or do you want to add a fix for this version too by using const { default: npmEmail } = await import('npm-email'); in the npmUser async function (which I can quickly PR)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.