wc-through

1.0.0 • Public • Published

SYNOPSIS

unix wc core util as a through stream, counts into an object

USAGE

as data passes though it increments the counter

  
  var counters = {}
 
  fs.createReadStream('./foo.txt')
    .pipe(wc(counters))
    .on('end', function() {
      console.log(counters)
    })
 

the result is something like this

{ "ccount": 219127, "wcount": 32584, "lcount": 655 }

Readme

Keywords

none

Package Sidebar

Install

npm i wc-through

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • hij1nx