Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "draftlog", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Update logged lines after logging them", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -39,2 +39,5 @@ ![DraftLog](midia/draftlog.png) | ||
DraftLog(console) | ||
// Or, in a single line: | ||
require('draftlog').into(console) | ||
``` | ||
@@ -56,3 +59,3 @@ | ||
Here is some interesting exemples: | ||
``` | ||
```javascript | ||
// Prints a clock incrementing one every second in the same line | ||
@@ -93,7 +96,9 @@ var draft = console.draft() | ||
```javascript | ||
// progess goes from 0 to 100 | ||
require('draftlog').into(console) | ||
// Input progess goes from 0 to 100 | ||
function ProgressBar(progress) { | ||
// Make it 50 characters length | ||
progress = Math.round(progress / 2) | ||
return '[' + '='.repeat(progess) + ' '.repeat(100 - progress) + '] ' + progress + '%' | ||
var units = Math.round(progress / 2) | ||
return '[' + '='.repeat(units) + ' '.repeat(50 - units) + '] ' + progress + '%' | ||
} | ||
@@ -110,2 +115,9 @@ | ||
## Learn from examples! | ||
We have a few of them ready for you to use! Take a look at [the examples folder](examples/). | ||
Remember to replace `require('../')` with `require('draftlog')`. | ||
Also, install [`chalk`](https://github.com/chalk/chalk) to get colors on your terminal ;) | ||
## Important things to know | ||
@@ -112,0 +124,0 @@ |
1702442
20
484
141