I work with several NPM accounts on a daily basis – one for work and a couple for my open source work. npm login
is a pain, which is why I wrote npm-user-switch
: A simple CLI tool to help easily manage switching accounts without having to remember each accounts password. You add the accounts to the app, set one master password (like with a password manager), and use that each time you want to switch account.
Once installed, simply run npm-user-switch
on the command line to launch the app. You’ll need to set the password the first time you use it. Add your accounts and configure how they’re named, then simply switch between them with ease.
npm-user-switch
actually uses Buttercup (NodeJS password manager) under the hood to store credentials, so you can be sure they’re encrypted and kept safe.