npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-cli-loader

v1.2.3

Published

Plugin to create animated loaders in the terminal

Downloads

84

Readme

Node CLI Loader

Plugin to create animated loaders in the terminal programmatically.

Install

npm install node-cli-loader

Usage

Creates a new loader:

// Default loader (Loading...)
Loader.create()

// Custom loader (Start loading...)
Loader.create('Start loading', { 
  spinname: 'dots',
  doneMessage: 'Loading finished!'
})

Arguments:

|name|DESCRIPTION|VALUE TYPE|EXAMPLE|DEFAULT| |---|---|---|---|---| |description|Message to show when loading and rendering|string| Requesting data| Loading| |options|Custom options for the loader|object| LoaderOptions | {} |

Options (LoaderOptions):

|name|DESCRIPTION|VALUE TYPE|EXAMPLE|DEFAULT| |---|---|---|---|---| |spinname|Name of the spinner to be displayed|string| 'dots', 'sand'| 'dots'| |doneMessage|Message to change the loader when finishes|string| 'Loading finish!' | | |timeout|The time in milliseconds to wait before stopping the loader|string| 1000 | |

See all the spinners.

Stop the loader and mark it as done.

const loader = Loader.create()
// Some logic here...
loader.finish()

Stop the loaders and mark them as failures:

Loader.interrupt()

Stops all loaders in course:

Loader.stopAll()

Based on packages:

  • https://github.com/chalk/ansi-regex
  • https://github.com/chalk/ansi-styles
  • https://github.com/chalk/slice-ansi
  • https://github.com/chalk/strip-ansi
  • https://github.com/chalk/wrap-ansi
  • https://github.com/grncdr/js-lookup
  • https://github.com/mathiasbynens/emoji-regex
  • https://github.com/sindresorhus/ansi-escapes
  • https://github.com/sindresorhus/cli-cursor
  • https://github.com/sindresorhus/cli-spinners
  • https://github.com/sindresorhus/get-east-asian-width
  • https://github.com/sindresorhus/is-fullwidth-code-point
  • https://github.com/sindresorhus/log-update
  • https://github.com/sindresorhus/mimic-function
  • https://github.com/sindresorhus/onetime
  • https://github.com/sindresorhus/restore-cursor
  • https://github.com/sindresorhus/string-width