Changelog
1.0.0 (2019-05-02)
This is a huge major release in which this module was essentially completely re-written. This version introduces some breaking changes and major new features. Please read the release notes below carefully.
Now requires at least Node v10.0.0
Code re-written in ES2018 code
Now supports a hybrid Promise/Callback API (supports async/await)
Now properly supports TCP/UNIX Domain socket communication to local or remote clamav services (with optional fallback to local binary via child process).
Added new scan_stream
method which allows you to pass an input stream.
Added new get_version
method which allows you to check the version of ClamAV that you'll be communicating with.
Added new passthrough
method which allows you to pipe a stream "through" the clamscan module and on to another destination (ex. S3).
Added new alias scan_file
that points to is_infected
.
In order to provide the name of any viruses found, a new standard viruses
array is now be provided to the callback for:
is_infected
& scan_file
methods (callback format: (err, file, is_infected, viruses) => { ... }
).scan_files
method (callback format: (err, good_files, bad_files, error_files, viruses) => { ... }
).scan_dir
method (callback format: (err, good_files, bad_files, viruses) => { ... }
).In all cases, the viruses
parameter will be an empty array on error or when no viruses are found.
scan_files
now has another additional parameter in its callback:
error_files
: An object keyed by the filenames that presented errors while scanning. The value of those keys will be the error message for that file.Introduces new API to instantiate the module (NOTE: The old way will no longer work! See below for more info).