Remove virustotal.js as a dependency
This commit is contained in:
parent
9202b59a5b
commit
fece70f66e
6 changed files with 31 additions and 32 deletions
11
lib/virustotal.js
Normal file
11
lib/virustotal.js
Normal 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'});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue