To segment a set of chunks from strings or streams
With npm do:
$ npm install segmenter
var Segmenter = require'segmenter'seg = delimiter: "." ;segfecth'a.b.c.';
[ 'a', 'b', 'c' ]
var seg =readStream = require'fs'createReadStream'dataset.txt'res = ;readStreamon'data'res = resconcatsegfetchchunk;;readStreamon'end'console.log'Array of lines' lines;;
[ 'Line 1', 'Line 2', 'etc.', ... ]
Use mocha to run the tests.
$ npm install mocha $ mocha test
Create the object.
Options are :
Fetch segments in a String.
Fetch segments in a Buffer.