Socket
Socket
Sign inDemoInstall

node-gyp

Package Overview
Dependencies
Maintainers
3
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-gyp - npm Package Compare versions

Comparing version 0.13.1 to 1.0.0

44

lib/install.js

@@ -75,2 +75,5 @@

// distributions starting with 0.10.0 contain sha256 checksums
var checksumAlgo = semver.gte(version, '0.10.0') ? 'sha256' : 'sha1'
// the directory where the dev files will be installed

@@ -157,3 +160,3 @@ var devDir = path.resolve(gyp.devDir, version)

function getContentSha(res, callback) {
var shasum = crypto.createHash('sha1')
var shasum = crypto.createHash(checksumAlgo)
res.on('data', function (chunk) {

@@ -248,7 +251,7 @@ shasum.update(chunk)

}
// content sha1
getContentSha(res, function (_, sha1) {
// content checksum
getContentSha(res, function (_, checksum) {
var filename = path.basename(tarballUrl).trim()
contentShasums[filename] = sha1
log.verbose('content sha1', filename, sha1)
contentShasums[filename] = checksum
log.verbose('content checksum', filename, checksum)
})

@@ -294,8 +297,8 @@

if (!async) {
log.verbose('download contents shasums', JSON.stringify(contentShasums))
log.verbose('download contents checksum', JSON.stringify(contentShasums))
// check content shasums
for (var k in contentShasums) {
log.verbose('validating download shasum for ' + k, '(%s == %s)', contentShasums[k], expectShasums[k])
log.verbose('validating download checksum for ' + k, '(%s == %s)', contentShasums[k], expectShasums[k])
if (contentShasums[k] !== expectShasums[k]) {
cb(new Error(k + ' local sha1 ' + contentShasums[k] + ' not match remote ' + expectShasums[k]))
cb(new Error(k + ' local checksum ' + contentShasums[k] + ' not match remote ' + expectShasums[k]))
return

@@ -310,7 +313,8 @@ }

function downloadShasums(done) {
log.verbose('check download content sha1, need to download `SHASUMS.txt`...')
var shasumsPath = path.resolve(devDir, 'SHASUMS.txt')
, shasumsUrl = distUrl + '/v' + version + '/SHASUMS.txt'
var shasumsFile = (checksumAlgo === 'sha256') ? 'SHASUMS256.txt' : 'SHASUMS.txt'
log.verbose('check download content checksum, need to download `' + shasumsFile + '`...')
var shasumsPath = path.resolve(devDir, shasumsFile)
, shasumsUrl = distUrl + '/v' + version + '/' + shasumsFile
log.verbose('`SHASUMS.txt` url', shasumsUrl)
log.verbose('checksum url', shasumsUrl)
var req = download(shasumsUrl)

@@ -321,3 +325,3 @@ if (!req) return

if (res.statusCode !== 200) {
done(new Error(res.statusCode + ' status code downloading SHASUMS.txt'))
done(new Error(res.statusCode + ' status code downloading checksum'))
return

@@ -341,3 +345,3 @@ }

log.verbose('`SHASUMS.txt` data', JSON.stringify(expectShasums))
log.verbose('checksum data', JSON.stringify(expectShasums))
done()

@@ -376,5 +380,5 @@ })

getContentSha(res, function (_, sha1) {
contentShasums['node.lib'] = sha1
log.verbose('content sha1', 'node.lib', sha1)
getContentSha(res, function (_, checksum) {
contentShasums['node.lib'] = checksum
log.verbose('content checksum', 'node.lib', checksum)
})

@@ -403,5 +407,5 @@

getContentSha(res, function (_, sha1) {
contentShasums['x64/node.lib'] = sha1
log.verbose('content sha1', 'x64/node.lib', sha1)
getContentSha(res, function (_, checksum) {
contentShasums['x64/node.lib'] = checksum
log.verbose('content checksum', 'x64/node.lib', checksum)
})

@@ -408,0 +412,0 @@

@@ -13,3 +13,3 @@ {

],
"version": "0.13.1",
"version": "1.0.0",
"installVersion": 9,

@@ -25,8 +25,8 @@ "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",

"dependencies": {
"glob": "3",
"graceful-fs": "2",
"glob": "3 || 4",
"graceful-fs": "3",
"fstream": "0",
"minimatch": "0",
"minimatch": "1",
"mkdirp": "0",
"nopt": "2",
"nopt": "2 || 3",
"npmlog": "0",

@@ -36,3 +36,3 @@ "osenv": "0",

"rimraf": "2",
"semver": "~2.2.1",
"semver": "2.x || 3.x",
"tar": "0",

@@ -39,0 +39,0 @@ "which": "1"

@@ -6,3 +6,4 @@ node-gyp

`node-gyp` is a cross-platform command-line tool written in Node.js for compiling
native addon modules for Node.js, which takes away the pain of dealing with the
native addon modules for Node.js. It bundles the [gyp](https://code.google.com/p/gyp/)
project used by the Chromium team and takes away the pain of dealing with the
various differences in build platforms. It is the replacement to the `node-waf`

@@ -9,0 +10,0 @@ program which is removed for node `v0.8`. If you have a native addon for node that

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