Socket
Socket
Sign inDemoInstall

pacote

Package Overview
Dependencies
Maintainers
1
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pacote - npm Package Compare versions

Comparing version 2.7.11 to 2.7.12

12

CHANGELOG.md

@@ -5,2 +5,14 @@ # Change Log

<a name="2.7.12"></a>
## [2.7.12](https://github.com/zkat/pacote/compare/v2.7.11...v2.7.12) (2017-05-16)
### Bug Fixes
* **fetch:** fix default userAgent ([4b9d344](https://github.com/zkat/pacote/commit/4b9d344))
* **registry:** log failed requests too ([0f23f06](https://github.com/zkat/pacote/commit/0f23f06))
* **remote:** send a useful pkg id header for remote tarballs ([ac13356](https://github.com/zkat/pacote/commit/ac13356))
<a name="2.7.11"></a>

@@ -7,0 +19,0 @@ ## [2.7.11](https://github.com/zkat/pacote/compare/v2.7.10...v2.7.11) (2017-05-12)

23

lib/fetchers/registry/fetch.js

@@ -31,12 +31,2 @@ 'use strict'

checkWarnings(res, registry, opts)
res.body.on('end', () => {
const elapsedTime = Date.now() - startTime
const attempt = res.headers.get('x-fetch-attempts')
const attemptStr = attempt && attempt > 1 ? ` attempt #${attempt}` : ''
const cacheStr = res.headers.get('x-local-cache') ? ' (from cache)' : ''
opts.log.http(
'fetch',
`GET ${res.status} ${uri} ${elapsedTime}ms${attemptStr}${cacheStr}`
)
})
if (res.status >= 400) {

@@ -50,4 +40,6 @@ const err = new Error(`${res.status} ${res.statusText}: ${

err.spec = opts.spec
logRequest(uri, res, startTime, opts)
throw err
} else {
res.body.on('end', () => logRequest(uri, res, startTime, opts))
return res

@@ -58,2 +50,13 @@ }

function logRequest (uri, res, startTime, opts) {
const elapsedTime = Date.now() - startTime
const attempt = res.headers.get('x-fetch-attempts')
const attemptStr = attempt && attempt > 1 ? ` attempt #${attempt}` : ''
const cacheStr = res.headers.get('x-local-cache') ? ' (from cache)' : ''
opts.log.http(
'fetch',
`GET ${res.status} ${uri} ${elapsedTime}ms${attemptStr}${cacheStr}`
)
}
function getCacheMode (opts) {

@@ -60,0 +63,0 @@ return opts.offline

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

'pacote-req-type': 'tarball',
'pacote-pkg-id': `registry:${manifest.name}@${manifest.version}`
'pacote-pkg-id': `registry:${
spec.type === 'remote'
? spec
: `${manifest.name}@${manifest.version}`
}`
},

@@ -43,0 +47,0 @@ integrity: manifest._integrity,

@@ -26,3 +26,3 @@ 'use strict'

this.scope = opts.scope
this.userAgent = opts.userAgent || `${pkg.name}@${pkg.version}/node@{process.version}+${process.arch} (${process.platform})`
this.userAgent = opts.userAgent || `${pkg.name}@${pkg.version}/node@${process.version}+${process.arch} (${process.platform})`
this.where = opts.where

@@ -29,0 +29,0 @@ this.preferOnline = opts.preferOnline

{
"name": "pacote",
"version": "2.7.11",
"version": "2.7.12",
"description": "JavaScript package downloader",

@@ -5,0 +5,0 @@ "main": "index.js",

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