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

iohook

Package Overview
Dependencies
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iohook - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

4

CHANGELOG.md
# CHANGELOG
## v0.5.1
* chore: Use SSL options when dealing with prebuilts.
## v0.5.0

@@ -4,0 +8,0 @@

90

install.js

@@ -6,3 +6,4 @@ 'use strict';

const os = require('os');
const get = require('simple-get');
const nugget = require('nugget');
const rc = require('rc');
const pump = require('pump');

@@ -34,10 +35,35 @@ const tfs = require('tar-fs');

let reqOpts = {url: downloadUrl};
let tempFile = path.join(os.tmpdir(), 'prebuild.tar.gz');
let req = get(reqOpts, function(err, res) {
if (err) {
return onerror(err);
}
if (res.statusCode !== 200) {
if (res.statusCode === 404) {
let nuggetOpts = {
dir: os.tmpdir(),
target: 'prebuild.tar.gz',
strictSSL: true
};
let npmrc = {};
try {
rc('npm', npmrc);
} catch (error) {
console.warn('Error reading npm configuration: ' + error.message);
}
if (npmrc && npmrc.proxy) {
nuggetOpts.proxy = npmrc.proxy;
}
if (npmrc && npmrc['https-proxy']) {
nuggetOpts.proxy = npmrc['https-proxy'];
}
if (npmrc && npmrc['strict-ssl'] === false) {
nuggetOpts.strictSSL = false;
}
nugget(downloadUrl, nuggetOpts, function(errors) {
if (errors) {
const error = errors[0];
if (error.message.indexOf('404') === -1) {
onerror(error);
} else {
console.error('Prebuild for current platform (' + currentPlatform + ') not found!');

@@ -48,34 +74,26 @@ console.error('Try to compile for your platform:');

console.error('');
return onerror('Prebuild for current platform (' + currentPlatform + ') not found!');
onerror('Prebuild for current platform (' + currentPlatform + ') not found!');
}
return onerror('Bad response from prebuild server. Code: ' + res.statusCode);
}
pump(res, fs.createWriteStream(tempFile), function(err) {
let options = {
readable: true,
writable: true,
hardlinkAsFilesFallback: true
};
let binaryName;
let updateName = function(entry) {
if (/\.node$/i.test(entry.name)) binaryName = entry.name
};
let targetFile = path.join(__dirname, 'builds', essential);
let extract = tfs.extract(targetFile, options)
.on('entry', updateName);
pump(fs.createReadStream(path.join(nuggetOpts.dir, nuggetOpts.target)), zlib.createGunzip(), extract, function(err) {
if (err) {
throw err;
return onerror(err);
}
let options = {
readable: true,
writable: true,
hardlinkAsFilesFallback: true
};
let binaryName;
let updateName = function(entry) {
if (/\.node$/i.test(entry.name)) binaryName = entry.name
};
let targetFile = path.join(__dirname, 'builds', essential);
let extract = tfs.extract(targetFile, options)
.on('entry', updateName);
pump(fs.createReadStream(tempFile), zlib.createGunzip(), extract, function(err) {
if (err) {
return onerror(err);
}
cb()
})
})
cb()
});
});
req.setTimeout(30 * 1000, function() {
req.abort()
})
}

@@ -82,0 +100,0 @@

{
"name": "iohook",
"version": "0.5.0",
"version": "0.5.1",
"description": "Node.js global keyboard and mouse hook",

@@ -41,4 +41,5 @@ "main": "index.js",

"node-abi": "^2.4.0",
"nugget": "^2.0.1",
"pump": "^1.0.3",
"simple-get": "^2.8.1",
"rc": "^1.2.8",
"tar-fs": "^1.16.2"

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