Skip to content

Commit

Permalink
added payload argument to increment() function #18
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiDittrich committed Jan 3, 2018
1 parent cdc84ab commit c5315f7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
@@ -1,3 +1,6 @@
### 1.7.0 ###
* Added: payload argument to `increment()` - feature requested by [dsego on GitHub](https://github.com/AndiDittrich/Node.CLI-Progress/issues/18) #18

### 1.6.1 ###
* Bugfix: `roundTo` parameter was not set for `elapsedTime` calculation which caused raw float values within formatted time strings - thanks to [rekinyz on GitHub](https://github.com/AndiDittrich/Node.CLI-Progress/pull/16) #16

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
@@ -1,6 +1,6 @@
The MIT License (X11 License)

Copyright (c) 2015-2017 Andi Dittrich
Copyright (c) 2015-2018 Andi Dittrich

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -92,10 +92,10 @@ Sets the current progress value and optionally the payload with values of custom

### ::increment() ###

Increases the current progress value by a specified amount (default +1)
Increases the current progress value by a specified amount (default +1). Update payload optionally

```js
<instance>.increment(delta:int);
<instance>.increment([delta:int [, payload:object = {}]]);
```

### ::stop() ###
Expand Down
4 changes: 2 additions & 2 deletions lib/Bar.js
Expand Up @@ -250,9 +250,9 @@ Bar.prototype.update = function(current, payload){
};

// update the bar value
Bar.prototype.increment = function(step){
Bar.prototype.increment = function(step, payload){
step = step || 1;
this.update(this.value + step);
this.update(this.value + step, payload);
};

// get the total (limit) value
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "cli-progress",
"version": "1.6.1",
"version": "1.7.0",
"description": "Easy to use Progress-Bar for Command-Line/Terminal Applications",
"keywords": [
"cli",
Expand Down

0 comments on commit c5315f7

Please sign in to comment.