clam-engine
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "clam-engine", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Native bindings for the clamav engine", | ||
@@ -9,2 +9,6 @@ "main": "index.js", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:srijs/node-clam-engine.git" | ||
}, | ||
"keywords": [ | ||
@@ -11,0 +15,0 @@ "clamav", |
# node-clam-engine | ||
Clam Engine provides robust native bindings to the clamav library. It allows you to scan files for viruses in-process, without requiring a running instance of `clamd`, or imposing the startup time of the `clamscan` command. | ||
## Installation | ||
### Dependencies | ||
Clam Engine requires `libclamav` to be present. | ||
- Ubuntu: `apt-get install libclamav-dev clamav-freshclam` | ||
- Homebew (OS X): `brew install clamav` | ||
### Via NPM | ||
Just run `npm install clam-engine`. Clam Engine supports Node.js 0.10, 0.11 and 0.12 as well as io.js. If something doesn't work for you using one of those runtimes, please file a bug. | ||
## Usage | ||
### Updating Signatures | ||
In order for Clam Engine to work, you need to update the clamav virus signatures by running the `freshclam` command. You will need to configure it firsy. | ||
### Example | ||
var clam = require('clam-engine'); | ||
clam.createEngine(function (err, engine) { | ||
if (err) { | ||
return console.log('Error', err); | ||
} | ||
engine.scanFile('eicar.com', function (err, virus) { | ||
if (err) { | ||
return console.log('Error', err); | ||
} | ||
if (virus) { | ||
return console.log('Virus', virus); | ||
} | ||
console.log('Clean'); | ||
}); | ||
}); | ||
### API | ||
- #### `clam.createEngine(cb)` | ||
Creates and initialises a new engine. The callback is called with `(err, engine)`. | ||
- #### `engine.version` | ||
Property that contains the version of the underlying clamav engine. | ||
- #### `engine.signatures` | ||
Propery that indicates the number of signatures loaded. | ||
- #### `engine.scanFile(filename, cb)` | ||
Scans a file for a virus. The callback is called with `(err, virus)`. `virus` is null if the file is clean. |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
8529
56
0