Skip to content

Commit c5315f7

Browse files
committed
added payload argument to increment() function #18
1 parent cdc84ab commit c5315f7

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 1.7.0 ###
2+
* Added: payload argument to `increment()` - feature requested by [dsego on GitHub](https://github.com/AndiDittrich/Node.CLI-Progress/issues/18) #18
3+
14
### 1.6.1 ###
25
* 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
36

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (X11 License)
22

3-
Copyright (c) 2015-2017 Andi Dittrich
3+
Copyright (c) 2015-2018 Andi Dittrich
44

55
Permission is hereby granted, free of charge, to any person
66
obtaining a copy of this software and associated documentation

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ Sets the current progress value and optionally the payload with values of custom
9292

9393
### ::increment() ###
9494

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

9797
```js
98-
<instance>.increment(delta:int);
98+
<instance>.increment([delta:int [, payload:object = {}]]);
9999
```
100100

101101
### ::stop() ###

lib/Bar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ Bar.prototype.update = function(current, payload){
250250
};
251251

252252
// update the bar value
253-
Bar.prototype.increment = function(step){
253+
Bar.prototype.increment = function(step, payload){
254254
step = step || 1;
255-
this.update(this.value + step);
255+
this.update(this.value + step, payload);
256256
};
257257

258258
// get the total (limit) value

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cli-progress",
3-
"version": "1.6.1",
3+
"version": "1.7.0",
44
"description": "Easy to use Progress-Bar for Command-Line/Terminal Applications",
55
"keywords": [
66
"cli",

0 commit comments

Comments
 (0)