hostr/lib/virustotal.js

12 lines
374 B
JavaScript
Raw Normal View History

2015-08-30 21:15:31 +02:00
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);
2016-06-06 15:37:00 +01:00
return yield fetch(`${apiRoot}/file/report`, { method: 'POST' });
2015-08-30 21:15:31 +02:00
}