smooth-progress
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "smooth-progress", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "pixel-by-pixel CLI progress bar", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
pixel-by-pixel progress bar | ||
![demo](https://raw.github.com/dickeyxxx/smooth-progress/master/demo.gif) | ||
Usage | ||
----- | ||
```js | ||
'use strict'; | ||
let https = require('https'); | ||
let progress = require('smooth-progress'); | ||
https.get('https://raw.githubusercontent.com/dickeyxxx/smooth-progress/master/demo.gif', function (rsp) { | ||
let bar = progress({ | ||
tmpl: 'Downloading... :bar :percent :eta', | ||
width: 25, | ||
total: parseInt(rsp.headers['content-length']), | ||
}); | ||
rsp.on('data', (chunk) => bar.tick(chunk.length)); | ||
}); | ||
``` |
4647
22