-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made it a little easier to digest by splitting into `docs/`
- Loading branch information
1 parent
a040b0d
commit db01e07
Showing
3 changed files
with
306 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
- `ProgressLogger` CLASS | ||
- jetta's native STDOUT streaming progress logger | ||
- can use be used: | ||
- In `jetta.request` via `options.useDefaultProgressLogger = true` | ||
- convenient | ||
- In `jetta.request` via `options.progressLog = new ProgressLogger()` | ||
- useful if you want to re-use multiple requests | ||
- Outside of `jetta.request`, for any of your progress logging needs | ||
- Example: | ||
```js | ||
const progressLogger = new jetta.ProgressLogger() | ||
``` | ||
|
||
- _new_ ProgressLogger () | ||
- Example: | ||
```js | ||
const progressLogger = new jetta.ProgressLogger() | ||
``` | ||
|
||
- _instance_ OBJECT | ||
- `longestLineLength` INTEGER | ||
- the length of the longest line of the output | ||
- `linesWrote` INTEGER | ||
- number of lines wrote | ||
- `finished` BOOLEAN | ||
- true if a `log`'s `current` met of exceeded the `total` | ||
|
||
- `log` (options) | ||
- logs progress to STDOUT | ||
- Example: | ||
```js | ||
const progressLogger = new jetta.ProgressLogger() | ||
progressLogger.log({current: 10, total: 125, name: 'example.com'}) | ||
``` | ||
|
||
- `options` OBJECT | ||
- `current` INTEGER | ||
- the current progress amount | ||
- `total` INTEGER | ||
- the total to be | ||
- `name` STRING | ||
- an identifier, preferably a URL, for the progress log line | ||
|
||
- `reset` () | ||
- resets `longestLine`, `linesWrote`, and `finished` |
Oops, something went wrong.