Initial commit — jibo-cli v3.0.7 with bundled node_modules
This commit is contained in:
20
node_modules/cli-spinner/LICENSE
generated
vendored
Normal file
20
node_modules/cli-spinner/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Pasquale Boemio
|
||||
|
||||
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.
|
||||
73
node_modules/cli-spinner/README.md
generated
vendored
Normal file
73
node_modules/cli-spinner/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# node-spinner
|
||||
|
||||
A simple spinner for node cli.
|
||||
|
||||
[](https://nodei.co/npm/cli-spinner/) [](https://nodei.co/npm/cli-spinner/)
|
||||
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
This package is available on [npm](http://npmjs.com) as `cli-spinner`.
|
||||
|
||||
``` sh
|
||||
npm install cli-spinner
|
||||
```
|
||||
|
||||
## Example usage
|
||||
|
||||
````javascript
|
||||
var Spinner = require('cli-spinner').Spinner;
|
||||
|
||||
var spinner = new Spinner('processing.. %s');
|
||||
spinner.setSpinnerString('|/-\\');
|
||||
spinner.start();
|
||||
````
|
||||
|
||||
## API
|
||||
|
||||
**`var obj = new Spinner('title')`**
|
||||
|
||||
Creates a new spinner object with the default options.
|
||||
|
||||
**`obj.start()`**
|
||||
|
||||
Starts the spinner.
|
||||
|
||||
**`obj.stop(clean)`**
|
||||
|
||||
Stops the spinner. Accepts a Boolean parameter to clean the console.
|
||||
|
||||
**`obj.setSpinnerString(spinnerString)`**
|
||||
|
||||
Sets the spinner string. Accepts either a String or an Integer index to reference the [built-in spinners](#demo).
|
||||
|
||||
**`obj.setSpinnerDelay(spinnerDelay)`**
|
||||
|
||||
Sets the spinner animation speed.
|
||||
|
||||
**`Spinner.setDefaultSpinnerString(spinnerString)`**
|
||||
|
||||
Sets the default spinner string for all newly created instances. Accepts either a String or an Integer index to reference the [built-in spinners](#demo).
|
||||
|
||||
**`Spinner.setDefaultSpinnerDelay(spinnerDelay)`**
|
||||
|
||||
Sets the default spinner delay for all newly created instances.
|
||||
|
||||
**`Spinner.setSpinnerTitle(spinnerTitle)`**
|
||||
|
||||
Sets the spinner title. Use printf-style strings to position the spinner.
|
||||
|
||||
**`Spinner.isSpinning()`**
|
||||
|
||||
Returns true/false depending on whether the spinner is currently spinning.
|
||||
|
||||
##Demo
|
||||
|
||||
To see a demonstration of the built-in spinners, point your console at the `example` folder and run:
|
||||
|
||||
````
|
||||
node spinner.js
|
||||
````
|
||||
|
||||

|
||||
41
node_modules/cli-spinner/example/spinner.js
generated
vendored
Normal file
41
node_modules/cli-spinner/example/spinner.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
var Spinner = require('../').Spinner;
|
||||
var numSpinners = Spinner.spinners.length;
|
||||
var spinner = null;
|
||||
var index = 0;
|
||||
var delay = 5000;
|
||||
|
||||
function nextSpinner(d) {
|
||||
d = d || delay;
|
||||
|
||||
setTimeout(function() {
|
||||
if (spinner !== null) {
|
||||
spinner.stop();
|
||||
process.stdout.write('\n');
|
||||
}
|
||||
|
||||
spinner = new Spinner('Spinner ' + (index+1) + ' of ' + numSpinners);
|
||||
spinner.setSpinnerString(index);
|
||||
spinner.start();
|
||||
|
||||
if (index < numSpinners) {
|
||||
index++;
|
||||
nextSpinner();
|
||||
} else {
|
||||
spinner.stop();
|
||||
process.stdout.write('\n');
|
||||
spinner = new Spinner('Spinner at custom position %s <--');
|
||||
spinner.start();
|
||||
|
||||
setTimeout(function() {
|
||||
spinner.stop();
|
||||
process.stdout.write('\n');
|
||||
spinner = new Spinner('Custom spinner with custom speed');
|
||||
spinner.setSpinnerString('slow');
|
||||
spinner.setSpinnerDelay(500);
|
||||
spinner.start();
|
||||
}, delay);
|
||||
}
|
||||
}, d);
|
||||
}
|
||||
|
||||
nextSpinner(0);
|
||||
BIN
node_modules/cli-spinner/img/spinner.gif
generated
vendored
Normal file
BIN
node_modules/cli-spinner/img/spinner.gif
generated
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 75 KiB |
113
node_modules/cli-spinner/index.js
generated
vendored
Normal file
113
node_modules/cli-spinner/index.js
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
var readline = require('readline');
|
||||
|
||||
var defaultSpinnerString = 0;
|
||||
var defaultSpinnerDelay = 60;
|
||||
|
||||
var Spinner = function(textToShow){
|
||||
this.text = textToShow || '';
|
||||
this.setSpinnerString(defaultSpinnerString);
|
||||
this.setSpinnerDelay(defaultSpinnerDelay);
|
||||
};
|
||||
|
||||
Spinner.spinners = [
|
||||
'|/-\\',
|
||||
'⠂-–—–-',
|
||||
'◐◓◑◒',
|
||||
'◴◷◶◵',
|
||||
'◰◳◲◱',
|
||||
'▖▘▝▗',
|
||||
'■□▪▫',
|
||||
'▌▀▐▄',
|
||||
'▉▊▋▌▍▎▏▎▍▌▋▊▉',
|
||||
'▁▃▄▅▆▇█▇▆▅▄▃',
|
||||
'←↖↑↗→↘↓↙',
|
||||
'┤┘┴└├┌┬┐',
|
||||
'◢◣◤◥',
|
||||
'.oO°Oo.',
|
||||
'.oO@*',
|
||||
'🌍🌎🌏',
|
||||
'◡◡ ⊙⊙ ◠◠',
|
||||
'☱☲☴',
|
||||
'⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏',
|
||||
'⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓',
|
||||
'⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆',
|
||||
'⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋',
|
||||
'⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁',
|
||||
'⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈',
|
||||
'⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈',
|
||||
'⢄⢂⢁⡁⡈⡐⡠',
|
||||
'⢹⢺⢼⣸⣇⡧⡗⡏',
|
||||
'⣾⣽⣻⢿⡿⣟⣯⣷',
|
||||
'⠁⠂⠄⡀⢀⠠⠐⠈',
|
||||
'🌑🌒🌓🌔🌕🌝🌖🌗🌘🌚'
|
||||
];
|
||||
|
||||
Spinner.setDefaultSpinnerString = function(value) {
|
||||
defaultSpinnerString = value;
|
||||
};
|
||||
|
||||
Spinner.setDefaultSpinnerDelay = function(value) {
|
||||
defaultSpinnerDelay = value;
|
||||
};
|
||||
|
||||
Spinner.prototype.start = function() {
|
||||
var current = 0;
|
||||
var self = this;
|
||||
this.id = setInterval(function() {
|
||||
var msg = self.text.indexOf('%s') > -1 ? self.text.replace('%s', self.chars[current]) : self.chars[current] + ' ' + self.text;
|
||||
clearLine();
|
||||
process.stdout.write(msg);
|
||||
current = ++current % self.chars.length;
|
||||
}, this.delay);
|
||||
};
|
||||
|
||||
Spinner.prototype.isSpinning = function() {
|
||||
return this.id !== undefined;
|
||||
}
|
||||
|
||||
Spinner.prototype.setSpinnerDelay = function(n) {
|
||||
this.delay = n;
|
||||
};
|
||||
|
||||
Spinner.prototype.setSpinnerString = function(str) {
|
||||
this.chars = mapToSpinner(str, this.spinners).split('');
|
||||
};
|
||||
|
||||
Spinner.prototype.setSpinnerTitle = function(str) {
|
||||
this.text = str;
|
||||
}
|
||||
|
||||
Spinner.prototype.stop = function(clear) {
|
||||
clearInterval(this.id);
|
||||
this.id = undefined;
|
||||
if (clear) {
|
||||
clearLine();
|
||||
}
|
||||
};
|
||||
|
||||
// Helpers
|
||||
|
||||
function isInt(value) {
|
||||
return (typeof value==='number' && (value%1)===0);
|
||||
}
|
||||
|
||||
function mapToSpinner(value, spinners) {
|
||||
// Not an integer, return as strng
|
||||
if (!isInt(value)) {
|
||||
return value + '';
|
||||
}
|
||||
|
||||
// Check if index is within bounds
|
||||
value = (value >= Spinner.spinners.length) ? 0 : value;
|
||||
// If negative, count from the end
|
||||
value = (value < 0) ? Spinner.spinners.length + value : value;
|
||||
|
||||
return Spinner.spinners[value];
|
||||
}
|
||||
|
||||
function clearLine() {
|
||||
readline.clearLine(process.stdout, 0);
|
||||
readline.cursorTo(process.stdout, 0);
|
||||
}
|
||||
|
||||
exports.Spinner = Spinner;
|
||||
61
node_modules/cli-spinner/package.json
generated
vendored
Normal file
61
node_modules/cli-spinner/package.json
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_from": "cli-spinner@>=0.2.5 <0.3.0",
|
||||
"_id": "cli-spinner@0.2.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-LUl6TjXqr4waekEVSIZoMMxSyshkIk3ff39CzM83MohHU0BDk0A7VoYbJNatkZ10TfJf2PAW37dxaHr6BEh8rA==",
|
||||
"_location": "/cli-spinner",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "cli-spinner@0.2.5",
|
||||
"name": "cli-spinner",
|
||||
"escapedName": "cli-spinner",
|
||||
"rawSpec": "0.2.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.2.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/cli-spinner/-/cli-spinner-0.2.5.tgz",
|
||||
"_shasum": "bea48d233bab5d30c2d214ebfb0aa1a2fac55447",
|
||||
"_spec": "cli-spinner@0.2.5",
|
||||
"_where": "/tmp/jibo-npm/jibo-cli-3.0.7",
|
||||
"author": {
|
||||
"name": "Pasquale Boemio",
|
||||
"email": "boemianrapsodi@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/helloIAmPau/node-spinner/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Bryce Kahle"
|
||||
},
|
||||
{
|
||||
"name": "Brian Hirt"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bleigh"
|
||||
}
|
||||
],
|
||||
"deprecated": false,
|
||||
"description": "A simple spinner",
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
},
|
||||
"homepage": "https://github.com/helloIAmPau/node-spinner#readme",
|
||||
"keywords": [
|
||||
"cli"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./index.js",
|
||||
"name": "cli-spinner",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/helloIAmPau/node-spinner.git"
|
||||
},
|
||||
"version": "0.2.5"
|
||||
}
|
||||
Reference in New Issue
Block a user