Extract data from text files or log files using regular expressions.
Extract data from files with regular expressions.
Extractor scans file line by line. Registred callbacks are notified when a patterm matches current line.
Start extracting stdin :
var extractor = require'file-extractor';extractormatches/;/console.logm;start;
Using multiple patterns :
var extractor = require'file-extractor';extractormatches/regex1/ cb1matches/regex2/ cb2matches/regex3/ cb3start;
$ npm install file-extractor
The constructor function creates a new
extractor. Optionnaly pass an accumulator as parameters.
Register a new matching pattern and corresponding callback. Each match is notified using call back.
Return value is
this to enable method chaining.
Start scanning stream and notify callbacks.
Sent when end of stream is reached.