npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@verdaccio/yarn-plugin-npm-login

v0.0.8

Published

Yarn 4 plugin that adds the yarn npm login command with web and legacy auth flows

Readme

@verdaccio/yarn-plugin-npm-login

Yarn 4 plugin that adds the yarn npm login command to authenticate against npm registries and store auth tokens.

Installation

yarn dlx @verdaccio/yarn-import npm-login

Or from a local build:

yarn plugin import ./packages/plugin-npm-login/bundles/@yarnpkg/plugin-npm-login.js

Usage

# Default (auto: web then legacy fallback)
yarn npm login

# Force legacy flow (Verdaccio, Nexus, self-hosted)
yarn npm login --auth-type=legacy --registry http://localhost:4873

# Log in against a scope's registry
yarn npm login --scope my-org

# Web login without auto-opening the browser
yarn npm login --auth-type=web --no-browser

# Non-interactive (CI/CD) — all credentials via flags
yarn npm login --auth-type=legacy \
  --user "$NPM_USER" --password "$NPM_PASS" --email "$NPM_EMAIL"

# Partial flags — prompts only for missing credentials
yarn npm login --auth-type=legacy --user alice

Options

| Option | Description | |---|---| | --auth-type <type> | Auth flow: auto (default), web, or legacy | | --user, --username | Username for legacy auth (skips prompt) | | --password | Password for legacy auth (skips prompt; emits security warning) | | --email | Email for legacy auth (skips prompt) | | --browser / --no-browser | Auto-open the login URL in a browser (default: on) | | --registry <url> | Override the registry URL | | --scope <scope> | Log in against the registry configured for a scope | | --json | Format the output as NDJSON |

Authentication flows

Web login

Posts to /-/v1/login, opens the returned URL in a browser, and polls the registry until the token is issued. Supports SSO and 2FA. Works with registries that implement the npm web login protocol (e.g. npmjs.org).

Legacy login

Prompts for username, password, and email (or accepts them via CLI flags), then PUTs a CouchDB user document to /-/user/org.couchdb.user:<name>. This matches the npm login / npm adduser behaviour:

  1. PUT /-/user/org.couchdb.user:<name> — creates the user if the registry allows it and returns a token.
  2. On 409 Conflict (user already exists) — GET /-/user/org.couchdb.user:<name>?write=true to fetch the existing doc with its _rev, merges the new credentials, then retries with PUT /-/user/org.couchdb.user:<name>/-rev/<rev>.

Works with Verdaccio, Nexus, JFrog, and most self-hosted registries.

Auto (default)

Tries web login first. Falls back to legacy if the registry responds with 404 or 501.

Token storage

Successfully obtained tokens are stored in ~/.yarnrc.yml under npmRegistries[<registry>].npmAuthToken.

License

MIT