Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including virustotal-api with all npm packages installed. Try it out:

var virustotalApi = require("virustotal-api")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

virustotal-api v1.0.3

virustotal api wrapper

virustotal-api

https://nodei.co/npm/virustotal-api.png?downloads=true&downloadRank=true&stars=true

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(data, '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.3

  • Dependency update to fix security vulnerabilities (lodash).

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

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free