npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

get-auth-token-from-npmrc

1.1.0

@zeke

npmHomeRepoSnykSocket
Downloads:227
$ npm install get-auth-token-from-npmrc
DailyWeeklyMonthlyYearly

get-auth-token-from-npmrc

Convenience module and CLI for extracting the auth token from your ~/.npmrc file

Hey! If you know of a better way to do this, please let me know.

Programmatic Usage

Install it locally:

npm i get-auth-token-from-npmrc --save

Then in your JS file:

const token = require('get-auth-token-from-npmrc')()
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

If ~/.npmrc exists and you're logged in to npm, a token is returned.

Otherwise, null is returned.

CLI Usage

Install it globally (or locally depending on your use-case):

npm i -g get-auth-token-from-npmrc && get-auth-token-from-npmrc

The token is written to stdout.

Dependencies

None

Dev Dependencies

None

License

MIT