← 返回首页
GitHub - jaywcjlove/loading-cli: Terminal loading effect. · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

jaywcjlove/loading-cli

 master
Go to file
Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
View all files

Repository files navigation

More items
Using my app is also a way to support me:

loading-cli

Terminal loading effect.

Install

$ npm install --save loading-cli

Usage

const loading = require('loading-cli'); const load = loading("loading text!!").start() setTimeout(function(){ load.color = 'yellow'; load.text = ' Loading rainbows'; },2000) // stop setTimeout(function(){ load.stop() },3000)

Custom text color colors-cli

const color = require('colors-cli/toxic'); const loading = require('loading-cli'); const load = loading("loading text!!".blue).start(); // stop setTimeout(function(){ load.stop() },3000)

API

loading([options|text])

options

load({ "text":"loading text!!", "color":"yellow", "interval":100, "stream": process.stdout, "frames":["◰", "◳", "◲", "◱"] })

text

Type: string Text to display after the spinner.

loading("loading text!!")

color

Values:black red green yellow blue magenta cyan white gray

frames

["", "", "", ""] ["", "", "", ""] [".", "o", "O", "°", "O", "o", "."] ["", ""] ["", ""] ["", "", "", "", "", "", "", ""] ["🕐 ", "🕑 ", "🕒 ", "🕓 ", "🕔 ", "🕕 ", "🕖 ", "🕗 ", "🕘 ", "🕙 ", "🕚 "]

Instance

.start([text])

Start the spinner. Returns the instance.

.stop()

Stop and clear the spinner. Returns the instance.

.clear()

Clear the spinner. Returns the instance.

.succeed([text])

Stop the spinner, change it to a green ✔ and persist the current text, or text if provided. Returns the instance. See the GIF below.

.fail([text])

Stop the spinner, change it to a red ✖ and persist the current text, or text if provided. Returns the instance. See the GIF below.

.warn([text])

Stop the spinner, change it to a yellow ⚠ and persist the current text, or text if provided. Returns the instance.

.info([text])

Stop the spinner, change it to a blue ℹ and persist the current text, or text if provided. Returns the instance.

.render()

Manually render a new frame. Returns the instance.

.frame()

Get a new frame.

const loading = require('loading-cli'); const load = loading("loading text!!"); load.frame(["◰", "◳", "◲", "◱"]); load.start();

.text

Change the text.

.color

Change the spinner color.

Contributors

As always, thanks to our amazing contributors!

Made with contributors.

License

Licensed under the MIT License.

About

Terminal loading effect.

Topics

Resources

Stars

56 stars

Watchers

2 watching

Forks

Sponsor this project

 
Sponsor

Packages

 
 
 

Contributors

Footer

© 2026 GitHub, Inc.