11 Jul 2013
Charm is a module used to write colors and cursor positions to a stream.
Let's build a simple progress indicator with charm.
npm install charm
Using setTimeout to write a charm bar. Because charm bar writes using the stream interface, using a blocking while loop will not write.
Download the latest release of node and tick the charm bar on each
req.on('data'... makes many trips around the event
loop, charm.write will actually write to the stream its piped to. In
this case process.stdout.
Same as the HTTP charm bar, but set the foreground color disco style!!
There you go, a simple way to write progress indicators in node.