Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-utils

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-utils - npm Package Compare versions

Comparing version 1.14.1 to 2.0.0

src/npm-prune-spec.js

37

package.json
{
"name": "npm-utils",
"description": "Async NPM shell commands",
"version": "1.14.1",
"version": "2.0.0",
"author": "Gleb Bahmutov <gleb.bahmutov@gmail.com>",

@@ -33,13 +33,14 @@ "bin": {

"chdir-promise": "0.4.1",
"check-more-types": "2.23.0",
"cross-spawn": "5.0.1",
"debug": "2.3.3",
"check-more-types": "2.24.0",
"cross-spawn": "5.1.0",
"debug": "2.6.8",
"del": "2.2.2",
"ggit": "1.13.4",
"lazy-ass": "1.5.0",
"local-or-home-npmrc": "github:bahmutov/local-or-home-npmrc",
"execa": "0.7.0",
"ggit": "1.23.0",
"lazy-ass": "1.6.0",
"local-or-home-npmrc": "1.1.0",
"q": "2.0.3",
"registry-url": "3.1.0",
"repo-url": "1.0.0",
"verbal-expressions": "0.2.1"
"repo-url": "1.0.1",
"verbal-expressions": "0.3.0"
},

@@ -50,18 +51,20 @@ "devDependencies": {

"git-issues": "1.3.1",
"github-post-release": "1.7.1",
"github-post-release": "1.12.1",
"grunt": "0.4.5",
"grunt-bump": "0.8.0",
"grunt-cli": "1.2.0",
"grunt-complexity": "0.3.0",
"grunt-complexity": "0.4.0",
"grunt-filenames": "0.4.0",
"grunt-nice-package": "0.10.3",
"grunt-nice-package": "0.10.4",
"gt": "0.10.0",
"matchdep": "1.0.1",
"mocha": "3.4.2",
"pkgfiles": "2.3.0",
"pre-git": "3.12.0",
"proxyquire": "1.7.10",
"next-update-travis": "1.5.2",
"pkgfiles": "2.3.2",
"pre-git": "3.15.0",
"proxyquire": "1.8.0",
"semantic-release": "6.3.6",
"standard": "8.6.0",
"temp": "0.8.3"
"temp": "0.8.3",
"tmp-sync": "1.1.2"
},

@@ -106,4 +109,4 @@ "engines": {

"test": "gt src/test/*.js --output",
"unit": "mocha src/*-spec.js"
"unit": "mocha --timeout 30000 src/*-spec.js"
}
}

@@ -14,2 +14,3 @@ # npm-utils

[![manpm](https://img.shields.io/badge/manpm-%E2%9C%93-3399ff.svg)](https://github.com/bahmutov/manpm)
[![next-update-travis badge][badge]][readme]

@@ -218,3 +219,3 @@ ## Use

[npm-utils-ci-image]: https://secure.travis-ci.org/bahmutov/npm-utils.svg?branch=master
[npm-utils-ci-url]: http://travis-ci.org/#!/bahmutov/npm-utils
[npm-utils-ci-url]: https://travis-ci.org/bahmutov/npm-utils
[dependencies-image]: https://david-dm.org/bahmutov/npm-utils.svg

@@ -228,1 +229,3 @@ [dependencies-url]: https://david-dm.org/bahmutov/npm-utils

[semantic-url]: https://github.com/semantic-release/semantic-release
[badge]: https://img.shields.io/badge/next--update--travis-%E2%9C%94%EF%B8%8F-green.svg
[readme]: https://github.com/bahmutov/next-update-travis#readme

@@ -6,2 +6,3 @@ var fs = require('fs')

const chdir = require('chdir-promise')
const la = require('lazy-ass')

@@ -57,5 +58,22 @@ temp.track()

console.log(npmrcContents)
la(npmrcContents.includes('//npm.example.com/:_authToken='))
})
})
it('sets the authentication token based on publishConfig URL', function () {
var customRegistry = 'https://npm.example.com/'
var npmrcPath = path.join(dirPath, '.npmrc')
var packagePath = path.join(dirPath, 'package.json')
fs.writeFileSync(npmrcPath, '@myco:registry=' + customRegistry, { encoding: 'utf8' })
fs.writeFileSync(packagePath, '{ "name": "@myco/test-package", "publishConfig": { "registry": "https://private.example.com/" } }', { encoding: 'utf8' })
return setAuthToken()
.then(function () {
var npmrcContents = fs.readFileSync(npmrcPath, 'utf8')
console.log(npmrcContents)
la(npmrcContents.includes('//private.example.com/:_authToken='))
})
})
})

@@ -38,7 +38,20 @@ 'use strict'

var cwd = process.cwd()
var packageName = getPackage(cwd).name
var packageContents = getPackage(cwd)
var packageName = packageContents.name
debug('package %s in folder %s', packageName, cwd)
var scope = packageName.split('/')[0]
var registry = registryUrl(scope)
// If set, prefer the value of the `packageConfig.registry` property over the value of the registry as set
// in the user's `.npmrc` file.
// In one scenario, a package may fetch its dependencies from a virtual registry that is an overlay of a private
// registry over the public npm registry. Yet, that package is configured to publish directly to the private registry
// URL. To account for this scenario we need to get the value of the private registry URL and configure it within
// the `.npmrc` file.
var registry
if (packageContents.publishConfig && packageContents.publishConfig.registry) {
registry = packageContents.publishConfig.registry
} else {
var scope = packageName.split('/')[0]
registry = registryUrl(scope)
}
console.log('setting auth token for registry', registry)

@@ -45,0 +58,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