Control a ClamAV daemon over TCP or Unix Domain Sockets.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore Add gitignore. Jan 30, 2013
LICENSE First working bunch of code, aka. v0.1.0. Jan 30, 2013
README.md Add correct error handling. Jan 30, 2013
clam.js add destroy method Feb 5, 2015
package.json 0.2.1 Feb 5, 2015

README.md

ClamJS

Control a ClamAV daemon over TCP or Unix Domain Sockets.

var clam = require('clam-js');

var scanner = clam({port:6666}, null, function () {

  this.version(function (err, version) {
    if (err) {
      console.log(err);
    } else {
      console.log('Now connected to clamd: ' + version);
    }
  });

  this.scan('~/joe/something.zip', function (err, isClean) {
    if (err) {
      console.log(err);
    } else {
      console.log('State of file: ' + (isClean ? 'clean' : 'infected'));
    }
  });

});

scanner.on('close', function (had_error) {
  console.log('Scanner session closed' + (had_error ? ' with error.' : '.'));
});

scanner.on('error', function (err) {
  console.log(err);
});