Remove virustotal.js as a dependency

This commit is contained in:
Jonathan Cremin 2015-08-30 21:15:31 +02:00
parent 9202b59a5b
commit fece70f66e
6 changed files with 31 additions and 32 deletions

11
lib/virustotal.js Normal file
View file

@ -0,0 +1,11 @@
import fetch from 'node-fetch';
import FormData from 'form-data';
const apiRoot = 'https://www.virustotal.com/vtapi/v2';
export function* getFileReport(resource, apiKey = process.env.VIRUSTOTAL_KEY) {
const form = new FormData();
form.append('apikey', apiKey);
form.append('resource', resource);
return yield fetch(`${apiRoot}/file/report`, { method: 'POST'});
}