Socket
Socket
Sign inDemoInstall

semantic-release

Package Overview
Dependencies
Maintainers
1
Versions
408
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semantic-release - npm Package Compare versions

Comparing version 3.3.2 to 3.4.0

tests/tap/npm-info.js

51

lib/npm-info.js
'use strict'
var async = require('async')
var npmconf = require('npmconf')
var request = require('request')
var efh = require('./error').efh
module.exports = function (pkgName, cb) {
var encodedPkgName = pkgName.replace(/\//g, '%2F')
request(process.env.npm_config_registry + encodedPkgName, efh(cb)(function (response, body) {
var res = {
version: null,
gitHead: null,
pkg: null
}
var registry = process.env.npm_config_registry
async.waterfall([
npmconf.load,
function (conf, callback) {
var cred = conf.getCredentialsByURI(registry)
var reqopts = {
url: registry + pkgName.replace(/\//g, '%2F'),
headers: {}
}
if (cred.token) {
reqopts.headers.Authorization = 'Bearer ' + cred.token
} else if (cred.auth) {
reqopts.headers.Authorization = 'Basic ' + cred.auth
}
callback(null, reqopts)
},
request,
function (response, body, callback) {
var res = {
version: null,
gitHead: null,
pkg: null
}
if (response.statusCode === 404 || !body) return cb(null, res)
if (response.statusCode === 404 || !body) return callback(null, res)
var pkg = JSON.parse(body)
var pkg = JSON.parse(body)
if (pkg.error) return cb(pkg.error)
if (pkg.error) return callback(pkg.error)
res.version = pkg['dist-tags'].latest
res.gitHead = pkg.versions[res.version].gitHead
res.pkg = pkg
res.version = pkg['dist-tags'].latest
res.gitHead = pkg.versions[res.version].gitHead
res.pkg = pkg
cb(null, res)
}))
callback(null, res)
}
], cb)
}
{
"name": "semantic-release",
"description": "automated semver compliant package publishing",
"version": "3.3.2",
"version": "3.4.0",
"author": "Stephan Bönnemann <stephan@boennemann.me>",

@@ -12,2 +12,3 @@ "bin": "./bin/semantic-release.js",

"abbrev": "^1.0.5",
"async": "^1.0.0",
"conventional-changelog": "0.0.17",

@@ -20,2 +21,3 @@ "error-first-handler": "^1.0.1",

"minimist": "^1.1.0",
"npmconf": "^2.1.2",
"parse-github-repo-url": "^1.0.0",

@@ -31,4 +33,5 @@ "request": "^2.53.0",

"nixt": "^0.4.1",
"nock": "^2.2.0",
"sinopia": "^1.0.0",
"standard": "^3.2.1",
"standard": "^3.11.1",
"tap-spec": "^3.0.0",

@@ -35,0 +38,0 @@ "tape": "^4.0.0"

@@ -7,2 +7,3 @@ 'use strict'

require('./tap/npm-info')(test)
require('./scenarios/custom-analyzer')(test, createModule)

@@ -9,0 +10,0 @@ require('./scenarios/custom-verification')(test, createModule)

Sorry, the diff of this file is not supported yet

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