npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

totalvirus-api

v1.0.0

Published

Node.js wrapper for VirusTotal API. Scan files, URLs, and fetch malware analysis reports.

Readme

🛡️ TotalVirus Scanner

A lightweight, modern, and powerful Node.js wrapper for the VirusTotal API.
Scan files, scan URLs, and fetch real-time malware analysis — with a single line of code.

⚡ Plug in your API key once, and you're ready to sniff out threats like a digital hound.


🧠 How It Works

TotalVirus Scanner connects directly with the VirusTotal v3 API, allowing you to:

  • 🔎 Scan files for malicious content by uploading them
  • 🌐 Scan URLs to detect phishing, malicious redirects, or unsafe domains
  • 📈 Retrieve scan reports using the analysis ID returned from a scan

All API calls are abstracted into neat promise-based functions for modern, hassle-free integration.


📦 Installation

npm install totalvirus-scanner

🚀 Quick Start

// Import and initialize with your VirusTotal API key
const scanner = require('totalvirus-scanner')('YOUR_API_KEY_HERE');

// Scan a file
scanner.scanFile('./example.exe')
  .then(console.log)
  .catch(console.error);

// Scan a URL
scanner.scanUrl('https://example.com')
  .then(console.log)
  .catch(console.error);

// Get a scan report by ID
scanner.getReport('your_analysis_id_here')
  .then(console.log)
  .catch(console.error);

🔧 Available Functions

| Function | Description | | -----------------------|--------------------------------------------| | scanFile(filePath) | Uploads a file and returns a scan analysis | | scanUrl(url) | Submits a URL for scan and returns analysis| | getReport(id) | Fetches the results of a scan by ID |


🔐 VirusTotal API Key Setup

To use this package, you need a free VirusTotal API key:
👉 Get API Key

Once you have your key, just pass it once:

const scanner = require('totalvirus-scanner')('YOUR_API_KEY');

No need to repeat it — it stays with the session.


📁 Folder Structure

totalvirus-scanner/
│
├── index.js               # Entry point
├── api/
│   └── virustotal.js      # Core scanning logic
├── package.json           # NPM metadata
└── README.md              # You’re reading it!

📊 Sample Output (getReport)

{
  "data": {
    "id": "u-12345abcd",
    "type": "analysis",
    "attributes": {
      "status": "completed",
      "stats": {
        "malicious": 1,
        "harmless": 68,
        "suspicious": 0,
        "undetected": 2,
        "timeout": 0
      }
    }
  }
}

🧪 Test It Locally

npm install /path/to/your/totalvirus-scanner

Then:

const scanner = require('totalvirus-scanner')('your_api_key');
scanner.scanUrl('https://example.com').then(console.log);

📝 License

MIT License © 2025 Vraj Suratwala


🧭 Description (for NPM)

A Node.js wrapper for the VirusTotal v3 API. Easily scan files and URLs, and retrieve malware analysis reports in real-time. Plug in your API key once and start scanning securely.

Conclusion

In the land of code, where threats may hide,
A tool was forged, with truth as its guide.
Give it a file, a link, a clue —
It scans, reveals, and protects you too.

TotalVirus Scanner — where scanning is simplified, and malware gets nullified. 🔥