0.1.3 • Published 8 years ago
iwc v0.1.3
Incremental word count
Display line, word, and chracter counts, just like wc, but updated with every chunk of data fed to stdin.
You can limit the counting to lines, words, or characters, like wc:
iwc [-l] [-w] [-c]If you don't specify any, it defaults to all three.
E.g.:
$ iwc < /usr/share/dict/words
235886 235916 2493109or after a quick npm install -g twilight json
$ twitter-curl | json -C text | iwc -w
14477Limitations:
- Only allows
STDINinput (standardwcallowsSTDINas well as filenames). It does not buffer or chunk intelligently, but simply uses
process.stdin.on('data', function(chunk) { ... })
iwc -lcan be 2-3x slower thanwc -l.iwcandiwc -ware even slower, since they tokenize and count words.
License
Copyright © 2013 Christopher Brown. MIT Licensed.