stevedore

Display loading animation in the terminal

MIT 5 个版本
安装
npm install stevedore
yarn add stevedore
pnpm add stevedore
bun add stevedore
README

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

版本列表
0.1.4 2015-04-25
0.1.3 2014-09-22
0.1.2 2014-09-15
0.1.1 2014-08-29
0.1.0 2014-08-27