Docs menunpm usernames

npm usernames

LPM.dev Registry holds the usernames of popular npm users for them. If you maintain a popular npm package, no other person can take your npm username on LPM.dev. To use the name, prove that you own the npm account.

Which names LPM holds

LPM holds the npm username of each person who maintains an npm package with at least 10,000 weekly downloads.

  • LPM measures the downloads once a month, from the daily counts of npm. It takes the middle week of the last eight weeks, so a burst of downloads does not count, however large, and neither does the first busy week of a new package.
  • npm sometimes loses the counts of a day. LPM leaves out the days that npm reports no downloads for across all packages. Any other day without downloads counts as 0.
  • If an npm username has a . or a _, LPM holds its hyphen form. For example, blake.regalia holds blake-regalia.
  • After LPM holds a name, the name stays held, even if the packages become less popular.
  • If an account or an organization on LPM.dev had the name before LPM held it, it keeps the name.
  • No other organization can take a held name.
  • LPM does not hold a name that is on its list of company and project names, such as angular or datadog. Only the company or the project can get those names, after a request. Names and verified domains explains how to request one.

Choose a held name

You can choose a held name when you sign up, or later under "Account" in "Settings". The form tells you that the name is held, and for which npm user.

  • If you sign up with a held name, LPM creates your account without a username. You can install packages, but you cannot publish packages under your own name until you prove the npm account.
  • If you choose a held name in "Settings", you keep your current username until you prove the npm account.
  • After you publish a package, you cannot change your username, so choose the held name before your first publish.

More than one account can wait for the same name. The first account that proves the npm account gets the name, and LPM sends an email to the other accounts. To stop waiting, open the "Verification" settings, select "Prove npm account" under "npm account", and then select "Stop waiting". You can also choose another username.

If you prove the npm account first, the "Verification" settings show its held name under "npm account". You can then choose the name under "Account" without waiting. If you already published under your username, your username cannot change. To use the held name, unlink the npm account and prove it from another account on LPM.dev. An account has one username, so proving an npm account does not give you a second one.

Prove your npm account

To prove that you own an npm account, you publish a small package to npm under your own npm scope. Only your npm account can publish to @<your npm username>. After the proof, you remove the package from npm.

With LPM CLI

Sign in to npm and to LPM.dev, and then run this command:

lpm verify-npm

The command publishes @<your npm username>/lpm-verify with your npm login, waits for LPM to find it, and then unpublishes the version it published. Your npm token stays on your computer. If LPM cannot confirm the proof, for example because npm is slow, the version stays on npm. Then open the "Verification" settings, select "Prove npm account", and select "Check npm" in the steps by hand to finish the proof. Run the npm unpublish command that the command printed.

If the "Verification" settings are open while the command runs, they show the npm account when LPM proves it.

By hand

  1. Open "Settings" and then "Verification". Under "npm account", select "Prove npm account", and then "Do it by hand instead".
  2. Enter your npm username.
  3. Select "Get a token".
  4. Save the package.json that the panel shows in an empty folder.
  5. In that folder, run npm publish --access public --tag lpm-verify. The tag keeps the latest version of a package that you already have.
  6. Select "Check npm".
  7. Run the npm unpublish command that the panel shows.

npm lets you unpublish a package within 72 hours of its publish if no other package depends on it.

What LPM looks at

LPM reads @<your npm username>/lpm-verify from npm and accepts the proof when all of these are true:

  • A version of the package has your token in its lpmVerification field.
  • npm says that your npm account published that version.
  • The version was published after LPM gave you the token.

A token works for 24 hours, and only one time. If it expires, get a new token.

Your profile

After you prove an npm account, your profile shows the npm account with a link to its page on npmjs.com. One npm account can belong to only one account on LPM.dev. To remove the link, open the "Verification" settings, select "Manage" next to the npm account, and then select "Unlink".