Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "clamscan", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"author": "Kyle Farris <kfarris@chomponllc.com> (http://chomponllc.com)", | ||
@@ -5,0 +5,0 @@ "description": "Use Node JS to scan files on your server with ClamAV's clamscan/clamdscan binary or via TCP to a remote server or local UNIX Domain socket. This is especially useful for scanning uploaded files provided by un-trusted sources.", |
@@ -591,3 +591,3 @@ [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-image]][node-url] [![Build Status][travis-image]][travis-url] | ||
```javascript | ||
const is_infected = await clamscan.scan_stream(stream); | ||
const {is_infected, viruses} = await clamscan.scan_stream(stream); | ||
``` | ||
@@ -594,0 +594,0 @@ |
@@ -11,2 +11,3 @@ const fs = require('fs'); | ||
const good_scan_dir = __dirname + '/good_scan_dir'; | ||
const empty_file = `${good_scan_dir}/empty_file.txt`; | ||
const good_scan_file = `${good_scan_dir}/good_file_1.txt`; | ||
@@ -1357,2 +1358,18 @@ const good_file_list = __dirname + '/good_files_list.txt'; | ||
}); | ||
it('should handle a 0-byte file', () => { | ||
const input = fs.createReadStream(empty_file); | ||
const output = fs.createWriteStream(passthru_file); | ||
const av = clamscan.passthrough(); | ||
input.pipe(av).pipe(output); | ||
output.on('finish', () => { | ||
const orig_file = fs.readFileSync(empty_file); | ||
const out_file = fs.readFileSync(passthru_file); | ||
expect(orig_file).to.eql(out_file); | ||
if (fs.existsSync(passthru_file)) fs.unlinkSync(passthru_file); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202880
20
2962