iwc

0.1.3 • Public • Published

Incremental word count

latest version published to npm

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  2493109

or after a quick npm install -g twilight json

$ twitter-curl | json -C text | iwc -w
14477

Limitations:

  • Only allows STDIN input (standard wc allows STDIN as well as filenames).

  • It does not buffer or chunk intelligently, but simply uses

    process.stdin.on('data', function(chunk) { ... })

  • iwc -l can be 2-3x slower than wc -l.

  • iwc and iwc -w are even slower, since they tokenize and count words.

License

Copyright © 2013 Christopher Brown. MIT Licensed.

Package Sidebar

Install

npm i iwc

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

3.65 kB

Total Files

3

Last publish

Collaborators

  • chbrown