Skip to content

Commit

Permalink
Fixes #110
Browse files Browse the repository at this point in the history
  • Loading branch information
kylefarris committed Mar 18, 2024
1 parent daa28b2 commit 84a7cee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,10 @@ rs.push('foooooo');
rs.push('barrrrr');
rs.push(null);

clamscan.scanStream(stream, (err, isInfected) => {
clamscan.scanStream(stream, (err, { isInfected. viruses }) => {
if (err) return console.error(err);
if (isInfected) return console.log("Stream is infected! Booo!");
console.log("Stream is not infected! Yay!");
if (isInfected) return console.log('Stream is infected! Booo!', viruses);
console.log('Stream is not infected! Yay!');
});
```

Expand Down
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2182,9 +2182,9 @@ class NodeClam {
* rs.push(null);
*
* // Callback Example
* clamscan.scanStream(stream, (err, isInfected) => {
* clamscan.scanStream(stream, (err, { isInfected, viruses }) => {
* if (err) return console.error(err);
* if (isInfected) return console.log('Stream is infected! Booo!');
* if (isInfected) return console.log('Stream is infected! Booo!', viruses);
* console.log('Stream is not infected! Yay!');
* });
*
Expand Down Expand Up @@ -2292,13 +2292,12 @@ class NodeClam {
// If the scan didn't finish, throw error
if (!finished) {
const err = new NodeClamError(
`Scan aborted.Reply from server: ${response.toString('utf8')} `
`Scan aborted. Reply from server: ${response.toString('utf8')} `
);
return hasCb ? cb(err, null) : reject(err);
}

// The scan finished

if (this.settings.debugMode)
console.log(`${this.debugLabel}: Raw Response: ${response.toString('utf8')} `);
const result = this._processResult(response.toString('utf8'), null);
Expand Down

0 comments on commit 84a7cee

Please sign in to comment.