REDROOM
PHP 8.1.33
Path:
Logout
Edit File
Size: 1.94 KB
Close
//lib/node_modules/npm/node_modules/registry-auth-token/README.md
Text
Base64
# registry-auth-token [](http://browsenpm.org/package/registry-auth-token)[](https://travis-ci.org/rexxars/registry-auth-token) Get the auth token set for an npm registry from `.npmrc`. Also allows fetching the configured registry URL for a given npm scope. ## Installing ``` npm install --save registry-auth-token ``` ## Usage Returns an object containing `token` and `type`, or `undefined` if no token can be found. `type` can be either `Bearer` or `Basic`. ```js var getAuthToken = require('registry-auth-token') var getRegistryUrl = require('registry-auth-token/registry-url') // Get auth token and type for default `registry` set in `.npmrc` console.log(getAuthToken()) // {token: 'someToken', type: 'Bearer'} // Get auth token for a specific registry URL console.log(getAuthToken('//registry.foo.bar')) // Find the registry auth token for a given URL (with deep path): // If registry is at `//some.host/registry` // URL passed is `//some.host/registry/deep/path` // Will find token the closest matching path; `//some.host/registry` console.log(getAuthToken('//some.host/registry/deep/path', {recursive: true})) // Find the configured registry url for scope `@foobar`. // Falls back to the global registry if not defined. console.log(getRegistryUrl('@foobar')) // Use the npm config that is passed in console.log(getRegistryUrl('http://registry.foobar.eu/', { npmrc: { 'registry': 'http://registry.foobar.eu/', '//registry.foobar.eu/:_authToken': 'qar' } })) ``` ## Return value ```js // If auth info can be found: {token: 'someToken', type: 'Bearer'} // Or: {token: 'someOtherToken', type: 'Basic'} // Or, if nothing is found: undefined ``` ## Security Please be careful when using this. Leaking your auth token is dangerous. ## License MIT-licensed. See LICENSE.
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
.npmignore
73 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
base64.js
322 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CHANGELOG.md
2.84 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
3.23 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.06 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
1.91 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
1.94 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
registry-url.js
229 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
yarn.lock
50.25 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).