-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added clam scan cli function #138
base: master
Are you sure you want to change the base?
Conversation
I'll run prettier to fix the formatting on this in a bit as well |
So, I think you can already do it with the currently library--you would just need 2 instances of the library which really isn't too big of a deal. This library already does not spin up a clamscan daemon as is (it should be already running on your server or other server). So, for example... import NodeClam from 'clamscan';
const cliScanner = new NodeClam().init({
clamscan: { path: '/usr/bin/clamscan', active: true },
clamdscan: { localFallback: true, active: false },
preference: 'clamscan',
});
const daemonScanner = new NodeClam().init({
clamscan: { active: true }, // or false if you dont want it to fallback
clamdscan: {
socket: false,
host: '127.0.0.1',
port: 3310,
timeout: 1000,
localFallback: true, // false, if you don't want it to try and fallback to the cli option
path: '/usr/bin/clamdscan',
active: true,
},
preference: 'clamdscan',
}); Lemme know if that works for you! |
Thanks for letting me know. I removed that function and added an example using the method you described in case anyone wants a reference for how to do that. If you want me to remove that example file let me know. Let me know what you think about the updated CLI flags I pushed to the |
Also let me know if you need me to write unit tests |
Noticed there was no ability to directly call the 'clamscan' CLI command directly. I think this will help users who have a subset of files they want to have special configurations for, but don't need another daemon spun up. I have also added a lot of missing arguments for clamscan.
Would like your feedback before I update the README.