Nothing Particularly Magnificent
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

virustotal-api

1.0.2 • Public • Published

virustotal-api

Virustotal API v2.0 wrapper class

Install

npm i virustotal-api

Example

const fs = require('fs')
const VirusTotalApi = require('virustotal-api')
const virusTotal = new VirusTotalApi('<YOUR API KEY>')
 
fs.readFile(__filename, (err, data) => {
  if (err) {
    console.log(`Cannot read file. ${err}`)
  } else {
    virusTotal.fileScan(buffer, 'file.js')
    .then((response) => {
      let resource = response.resource
      // sometime later try:
      virusTotal.fileReport(resource)
        .then((result) => {
          console.log(result)
        })
    })
    .catch(err => console.log(`Scan failed. ${err}`))
  }
})

For more info please refer to documentation

Changes

Version 1.0.2

  • Documentation updated to include error handling.
  • Validating buffer size in fileScan in case anti-malware blocks access to file.

Version 1.0.1

Documentation update on urlReport

Version 1.0.0

Initial release

install

npm i virustotal-api

Downloadsweekly downloads

18

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability