Socket
Socket
Sign inDemoInstall

registry-auth-token

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

registry-auth-token - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

registry-url.js

4

index.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc