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

node-virustotal

Package Overview
Dependencies
Maintainers
1
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-virustotal - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

46

code.js

@@ -166,5 +166,47 @@ var https = require("https");

};
var sendFile = function(filename, filetype, filecontent, responseProc, errProc){
var sendOptions = {
url: "https://www.virustotal.com/vtapi/v2/file/scan?apikey=" + key,
formData: {
file: {
value: filecontent,
options: {
filename: filename,
filetype: filetype
}
}
}
};
var sendFileProc = function(){
request.post(sendOptions, function(error, response, body){
if (error) {
errProc(error);
return;
}
try{
var data = JSON.parse(body);
switch (data.response_code) {
case 1:
responseProc(data);
return;
case 0:
case -1:
case -2:
default:
errProc(data);
return;
}
} catch (e) {
errProc(e);
return;
}
});
};
addJob(sendFileProc);
};
this.submitFileForAnalysis = sendFile;
this.publishFileComment = publishUrlComment;
this.publishUrlComment = publishUrlComment;
this.retrieveUrlAnalysis = PostWithoutBody("http://www.virustotal.com/vtapi/v2/url/report?resource=", -2);
this.retrieveUrlAnalysisWithRescan = PostWithoutBody("http://www.virustotal.com/vtapi/v2/url/report?scan=1&resource=", -2);
this.retrieveUrlAnalysis = PostWithoutBody("https://www.virustotal.com/vtapi/v2/url/report?resource=", -2);
this.retrieveUrlAnalysisWithRescan = PostWithoutBody("https://www.virustotal.com/vtapi/v2/url/report?scan=1&resource=", -2);
this.submitUrlForScanning = PostWithoutBody("https://www.virustotal.com/vtapi/v2/url/scan?url=", 0);

@@ -171,0 +213,0 @@ this.checkIPv4 = makeGet("https://www.virustotal.com/vtapi/v2/ip-address/report?ip=");

8

package.json
{
"name": "node-virustotal",
"version": "0.1.7",
"version": "0.1.8",
"description": "An implementation of the Virustotal API for Node.js",

@@ -25,7 +25,7 @@ "main": "code.js",

"dependencies": {
"yellow-stream": "^0.0.13",
"speedconcat": "^1.0.2",
"request": "^2.72.0"
"yellow-stream": "^0.0.14",
"speedconcat": "^1.0.2",
"request": "^2.72.0"
},
"homepage": "https://github.com/natewatson999/node-virustotal#readme"
}

@@ -29,3 +29,8 @@ var vt = require("./code.js");

});
con.submitFileForAnalysis("obvious_virus.svg", "text/svg", fs.readFileSync("./obvious_virus.svg"), function(data){
console.log(data);
}, function(mistake){
console.log(mistake);
});
/*Sidenote: That's a real phishing site. It was shut down, but I still advise against going to it.*/
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