I am trying to use clamscan on my windows 10 pro machine in NodeJS. Clamscan is installed to
C:\Program Files\ClamAV
I have this code..
const NodeClam = require('clamscan');
const ClamScan = new NodeClam().init({
scan_recursively: false,
clamdscan: {
path: 'C:\Program Files\ClamAV\clamscan.exe',
local_fallback: true,
config_file: 'C:\Program Files\ClamAV\clamd.conf'
},
});
async function scanFile(filePath) {
try {
const clamscan = await ClamScan;
const { is_infected, viruses } = await clamscan.scan_file(filePath);
if (is_infected) {
console.log(`The file is INFECTED with ${viruses}`);
throw new Error('ERR_FILE_SCAN_INFECTED');
} else {
return 'CLEAN';
}
} catch (err) {
throw new Error(err);
}
}
function start() {
return scanFile('/dodgyfile.rtf');
}
// Call start
(async() => {
try{
await start();
}
catch(err){
console.log("error: ",err);
}
})();
I get the error.. No valid & active virus scanning binaries are active and available and no host/socket option provided!
All the config examples online seem to be for the linux path..
Does anyone have experience of using this on windows? Thanks