get-npm-token

exchange npm credentials for an api token

Usage no npm install needed!

<script type="module">
  import getNpmToken from 'https://cdn.skypack.dev/get-npm-token';
</script>

README

get-npm-token

username, email and password in – token out.

var getToken = require('get-npm-token')

getToken('https://registry.npmjs.org/', 'boennemann', 'stephan@boennemann.me', '***', console.log)
// the-token
npm install -g get-npm-token
get-npm-token
> ? npm registry https://registry.npmjs.org/
> ? npm username? boennemann
> ? npm email stephan@boennemann.me
> ? npm password ***
> the-token

The CLI securely caches answers in the npm config/os keychain (if available) so a repeated call looks like this:

> ? npm registry (https://registry.npmjs.org/) # prefilled
> ? npm username? (boennemann) # prefilled
> ? npm email (stephan@boennemann.me) # prefilled
> # no more password required, use -f if you changed it
> another-token