Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/heapwolf/wc-through

unix wc core util as a through stream, counts into an object
https://github.com/heapwolf/wc-through

Last synced: 25 days ago
JSON representation

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

Awesome Lists containing this project

README

        

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

# USAGE

as data passes though it increments the counter

```js

var counters = {}

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

```

the result is something like this

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