Open
Conversation
Contributor
Author
|
I'll run prettier to fix the formatting on this in a bit as well |
Owner
|
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! |
Contributor
Author
|
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 |
Contributor
Author
|
Also let me know if you need me to write unit tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.