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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@oneteam/clamav

v1.0.1

Published

a network only clamd client

Downloads

8

Readme

@oneteam/clamav

This is a nodejs network only client for clamav daemon using the INSTREAM command.

We have been using clamscan with much success until file sizes started to get above 600MB at which point clamscan starts to timeout. This module goes back to basic and only supports network operation (clamd doesn't need to be installed locally, it needs to be available on the network though).

To scan a file:

const { scanFile } = require("@oneteam/clamav");
//clamd must be available at 127.0.0.1/3310
const result = await scanFile("myFilePath");
// result.path: "myFilePath"
// result.status: "FOUND"
// result.virus: "Virus Name"
//or
// result.status: "OK" => all good
//or
// result.status: "ERROR" => something went wrong

To scan a stream (eg before saving a file):

const { ClamdNetworkSocket } = require("@oneteam/clamav");
const address = "127.0.0.1"; // your clamd server address
const port = "3310"; // your clamd port number
const cd = new ClamdNetworkSocket(address, port);
const myStream = ...;
const result = await cd.instream("stream name", myStream);
// result.path: "stream name"
// result.status: "FOUND"
// result.virus: "Virus Name"
//or
// result.status: "OK" => all good
//or
// result.status: "ERROR" => something went wrong

clamavCLI

  • node clamavCLI.js print the help
  • node clamavCLI.js samples run the scan on samples in parallel
  • node clamavCLI.js eicar create and run the scan on eicar file
  • node clamavCLI.js path/to/my/file this will scan path/to/my/file

Developers

To get started, make sure docker is installed.

This is setup to work on unix like systems, but mostly to get started, once you have generated the samples file, no need for that anymore.

  • ./makeSamples.sh to generate the samples

  • npm run clamav this will start the docker daemon with clamav using the provided config on first run the virus database will get downloaded

  • npm run clamdtop once the docker daemon is started, this will provide a view on the clamav instance best viewed on 80x24 console

  • npm test run tests

  • npm run test:watch run tests continuously

  • npm run test:log run tests with continuously debug logs

  • npm run test:samples run a scan on the samples in parallel