stevedore
v0.1.4 spinner loader cli terminal progress indicator
stevedore
Display a loading animation in the terminal:
[ ===] loading...
[====] loading...
[=== ] loading...
[== ] loading...
Installation
npm i stevedore
Usage
var stevedore = require( 'stevedore' );
var loader = stevedore();
// later...
loader.stop();
Options
You can pass in options like so:
var loader = stevedore({
message: 'loading...', // text to display after the animation frame
interval: 200 // interval between frames
frames: '-\\|/'.split( '' ) // an array of frames
});
You can adjust these options on the fly:
var loader = stevedore({
message: 'initialising...',
interval: 200
});
// later...
loader.message( 'reticulating splines...' ).interval( 100 );
By default, the loader will update every 100 milliseconds. You can manually instruct it to tick instead:
stream.on( 'data', loader.tick );
This will prevent the loader from automatically ticking in future.
License
MIT