-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vincent Riva
committed
Sep 17, 2018
1 parent
77b518c
commit 0f5be3d
Showing
6 changed files
with
102 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Obvious | ||
/node_modules/ |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Vincent Laurent Riva | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,60 @@ | ||
# eider.js | ||
|
||
`eider.js` is a simple CLI-progress bar for Node. | ||
|
||
- [Installation](#installation) - [NPM](#with-npm-recommended) - [Git](#with-git) | ||
- [Usage](#usage) - [Import](#import) - [Example](#example) - [Options](#options) | ||
|
||
 | ||
|
||
Inspired by Symfony Progress Bar (https://symfony.com/doc/current/components/console/helpers/progressbar.html) | ||
|
||
# Installation | ||
|
||
## With NPM (recommended) | ||
|
||
`npm install eider.js --save` | ||
|
||
## With Git | ||
|
||
`git clone https://github.com/Treast/eider.js.git` | ||
`mv ./eider.js/lib/eider.js ./foo/bar` | ||
|
||
# Usage | ||
|
||
## Import | ||
|
||
`const Eider = require('eider');` | ||
|
||
## Example | ||
|
||
const Eider = require('../lib/eider'); | ||
|
||
// new Eider(progressBarSteps, progressBarLength, progressBarOptions) | ||
let eider = new Eider(50, 40); | ||
|
||
setInterval(() => { | ||
eider.advance(); | ||
}, 300); | ||
|
||
eider.start(); | ||
|
||
## Options | ||
|
||
| Name | Type | Default | Description | | ||
| ----------- | --------- | ------- | ---------------------------------------------------- | | ||
| startChar | `char` | `[` | First character of the progress bar | | ||
| endChar | `char` | `]` | Last character of the progress bar | | ||
| doneChar | `char` | `#` | Character displayed when the step is done | | ||
| currentChar | `char` | `>` | Character displayed when the step is currently doing | | ||
| undoneChar | `char` | `-` | Character displayed when the step is undone | | ||
| count | `boolean` | `true` | Display the step count | | ||
| percentage | `boolean` | `true` | Display the percentage | | ||
|
||
## Methods | ||
|
||
| Methods | Description | | ||
| ------------ | --------------------------------------- | | ||
| `start()` | Start the progress bar | | ||
| `stop()` | Stop the progress bar | | ||
| `advance(n)` | Increment the progress bar by `n` steps | |
File renamed without changes.
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 |
---|---|---|
|
@@ -2,10 +2,27 @@ | |
"name": "eider.js", | ||
"version": "1.0.0", | ||
"description": "A simple CLI-progress bar", | ||
"main": "index.js", | ||
"main": "lib/eider.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Treast/eider.js.git" | ||
}, | ||
"keywords": [ | ||
"progressbar", | ||
"progress", | ||
"bar", | ||
"cli-progress", | ||
"eider.js", | ||
"eider", | ||
"progression" | ||
], | ||
"author": "Vincent Riva <[email protected]>", | ||
"license": "ISC" | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/Treast/eider.js/issues" | ||
}, | ||
"homepage": "https://github.com/Treast/eider.js#readme" | ||
} |