clam-js
v0.2.1
Published
Control a ClamAV daemon over TCP or Unix Domain Sockets.
Downloads
2
Readme
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);
});