registry-auth-token
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -16,6 +16,4 @@ var path = require('path') | ||
var regUrl = '//' + parsed.host + pathname.replace(/\/$/, '') | ||
var urlAlt = regUrl.slice(-1) === '/' ? regUrl : regUrl + '/' | ||
match = npmrc[regUrl + tokenKey] || npmrc[regUrl + '/' + tokenKey] | ||
match = npmrc[regUrl + tokenKey] || npmrc[urlAlt + tokenKey] | ||
if (match) { | ||
@@ -22,0 +20,0 @@ match = match.replace(/^\$\{?([^}]*)\}?$/, function (fullMatch, envVar) { |
{ | ||
"name": "registry-auth-token", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Get the auth token set for an npm registry (if any)", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha test.js", | ||
"test": "mocha", | ||
"posttest": "eslint .", | ||
@@ -9,0 +9,0 @@ "coverage": "istanbul cover _mocha" |
@@ -5,3 +5,3 @@ # registry-auth-token | ||
Get the auth token set for an npm registry from `.npmrc` | ||
Get the auth token set for an npm registry from `.npmrc`. Also allows fetching the configured registry URL for a given npm scope. | ||
@@ -18,2 +18,3 @@ ## Installing | ||
var getAuthToken = require('registry-auth-token') | ||
var getRegistryUrl = require('registry-auth-token/registry-url') | ||
@@ -31,2 +32,6 @@ // Get auth token for default `registry` set in `.npmrc` | ||
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')) | ||
``` | ||
@@ -33,0 +38,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11857
9
218
43
7
1