Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Control a ClamAV daemon over TCP or Unix Domain Sockets.
JavaScript
Branch: master

0.2.1

latest commit 077450373b
@srijs authored
Failed to load latest commit information.
.gitignore
LICENSE
README.md Add correct error handling.
clam.js
package.json 0.2.1

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);
});
Something went wrong with that request. Please try again.