Skip to content

cbmongithub/cli-loaders

Repository files navigation

Cli Loaders Repo Github Banner

cli-loaders

A collection of cli loaders for your command-line applications.

Visit the website to see all loaders!

Installation

To install the package, use npm or yarn:

npm install cli-loaders
# or
yarn add cli-loaders
# or
bun install cli-loaders

Usage

Importing Loaders

Import the loader initializer

import { initLoader } from 'cli-loaders';

Initializing a Loader

You can initialize any loader by its name using initLoader

import { initLoader } from 'cli-loaders';

// Initialize by name
initLoader('dots_variant_1');

Customizing the Speed

You can also customize the speed of the loader:

import { initLoader } from 'cli-loaders';

// Initialize with custom speed
initLoader('dots_variant_1', 100);

Customizing everything

New to v2.0+, you can import a custom loader initializer, initCustomLoader

import { initCustomLoader } from 'cli-loaders';

Then use it with your own speed and keyframe arguments:

initCustomLoader(100, ["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]);

Upgrading versions

Upgrading versions can be breaking. Double check the website first, to see if a loader has moved or is following a new naming convention. The website will always be updated with the most current version of cli-loaders.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Special Thanks

Special thanks to cli-spinners and sindresorhus for the json file for some of the loaders in this project.