Skip to content

Commit

Permalink
Tidy up README (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
justsml authored and AndiDittrich committed Oct 27, 2019
1 parent 9412750 commit f311db1
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ Usage
Multiple examples are available e.g. [example.js](https://github.com/AndiDittrich/Node.CLI-Progress/blob/master/examples/example.js) - just try it `$ node example.js`

```js
const _cliProgress = require('cli-progress');
const cliProgress = require('cli-progress');

// create a new progress bar instance and use shades_classic theme
const bar1 = new _cliProgress.SingleBar({}, _cliProgress.Presets.shades_classic);
const bar1 = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);

// start the progress bar with a total value of 200 and start value of 0
bar1.start(200, 0);
Expand All @@ -60,10 +60,10 @@ Single Bar Mode
### Example ###

```js
const _cliProgress = require('cli-progress');
const cliProgress = require('cli-progress');

// create new progress bar
const b1 = new _cliProgress.SingleBar({
const b1 = new cliProgress.SingleBar({
format: 'CLI Progress |' + _colors.cyan('{bar}') + '| {percentage}% || {value}/{total} Chunks || Speed: {speed}',
barCompleteChar: '\u2588',
barIncompleteChar: '\u2591',
Expand All @@ -88,9 +88,9 @@ b1.stop();
Initialize a new Progress bar. An instance can be used **multiple** times! it's not required to re-create it!

```js
const _cliProgress = require('cli-progress');
const cliProgress = require('cli-progress');

const <instance> = new _cliProgress.SingleBar(options:object [, preset:object]);
const <instance> = new cliProgress.SingleBar(options:object [, preset:object]);
```

#### Options ####
Expand Down Expand Up @@ -144,14 +144,14 @@ Multi Bar Mode
### Example ###

```js
const _cliProgress = require('cli-progress');
const cliProgress = require('cli-progress');

// create new container
const multibar = new _cliProgress.MultiBar({
const multibar = new cliProgress.MultiBar({
clearOnComplete: false,
hideCursor: true

}, _cliProgress.Presets.shades_grey);
}, cliProgress.Presets.shades_grey);

// add bars
const b1 = multibar.create(200, 0);
Expand All @@ -170,9 +170,9 @@ multibar.stop();
Initialize a new multiprogress container. Bars need to be added. The options/presets are used for each single bar!

```js
const _cliProgress = require('cli-progress');
const cliProgress = require('cli-progress');

const <instance> = new _cliProgress.MultiBar(options:object [, preset:object]);
const <instance> = new cliProgress.MultiBar(options:object [, preset:object]);
```

### ::create() ###
Expand Down Expand Up @@ -259,7 +259,7 @@ For a full example (including params) take a look on `lib/formatter.js`
### Example ###

```js
function myFormatter(options, params, payload){
function formatter(options, params, payload){

// bar grows dynamically by current progrss - no whitespaces are added
const bar = options.barCompleteString.substr(0, Math.round(params.progress*options.barsize));
Expand All @@ -274,7 +274,7 @@ function myFormatter(options, params, payload){
}

const opt = {
format: myFormatter
format: formatter
}
```

Expand Down Expand Up @@ -345,7 +345,7 @@ bar.stop();

### Example 4 - Custom Presets ###

**File** `mypreset.js`
**File** `myPreset.js`

```js
const _colors = require('colors');
Expand All @@ -360,11 +360,11 @@ module.exports = {
**Application**

```js
const _mypreset = require('./mypreset.js');
const myPreset = require('./myPreset.js');

const bar = new _progress.Bar({
barsize: 65
}, _mypreset);
}, myPreset);
```


Expand Down

0 comments on commit f311db1

Please sign in to comment.