New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nyks

Package Overview
Dependencies
Maintainers
1
Versions
253
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nyks - npm Package Compare versions

Comparing version 0.7.9 to 0.7.10

2

package.json
{
"name": "nyks",
"version": "0.7.9",
"version": "0.7.10",
"description": "nodejs exupery style",

@@ -5,0 +5,0 @@ "keywords": [

@@ -6,9 +6,8 @@ var fs = require('fs'),

http.downloadFile = function(remote_url, file_path, callback){
if(remote_url.startsWith('https://'))
return https.downloadFile(remote_url, file_path, callback);
var download = function(transport, remote_url, file_path, callback){
var file = fs.createWriteStream(file_path);
var request = http.get(remote_url, function(response) {
var request = transport(remote_url, function(response) {
if (response.statusCode != 200)
return callback( {error: "Invalid http exit code", code: response.statusCode });

@@ -22,20 +21,19 @@ file.on('finish', function () {

response.pipe(file);
}).on('error', function(){
callback( {error:"Cannot reach remote endpoint " + remote_url});
});
}
http.downloadFile = function(remote_url, file_path, callback){
if(remote_url.startsWith('https://'))
return https.downloadFile(remote_url, file_path, callback);
return download(http.get, remote_url, file_path, callback);
}
https.downloadFile = function(remote_url, file_path, callback){
var file = fs.createWriteStream(file_path);
return download(https.get, remote_url, file_path, callback);
var request = https.get(remote_url, function(response) {
file.on('finish', function () {
file.close(function(){
callback(null, file_path);
});
});
response.pipe(file);
});
}

@@ -42,0 +40,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