Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/heapwolf/wc-through
- Owner: heapwolf
- Created: 2014-03-05T09:00:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-03-05T09:20:07.000Z (over 10 years ago)
- Last Synced: 2024-10-18T17:07:30.506Z (26 days ago)
- Language: JavaScript
- Homepage:
- Size: 125 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 }
```