This is official (NativeExtractor)[https://github.com/SpongeData-cz/nativeextractor] binding for Node.js


Installation
Requirements
- Node.JS >=10
npm
build-essential
(gcc, make)
libglib2.0
, libglib2.0-dev
We recommend to use virtual environments.
sudo pip install nodeenv
nodeenv myproject
source myproject/bin/activate
Instant npm solution
TODO:
npm install nativeextractor.js
Manual
Typical usage
const ne = require('nativeextractor.js');
const path = require('path');
let results = [];
function test() {
const ex = new ne.Extractor();
if (!ex.addMiner(path.join(ne.defaultMinersPath, "naive_email_miner.so"), "match_email_naive")) {
console.log(ex.getLastError());
return;
}
const buffer = "some@email.org dead beaf";
const stream = new ne.BufferStream(buffer);
ex.setStream(stream);
if (ex.eof()) {
return;
}
ex.next(function (err, res) {
console.log(res);
results = [...results, ...res];
if (ex.eof()) {
ex.unsetStream();
return;
}
ex.next(arguments.callee);
});
}
test();