Coder Social home page Coder Social logo

spinner's Introduction

Spinner

spin'er

npm pipeline license downloads

Gitlab Github Twitter Discord

A single module for all your spinner and progress bar needs. Get spin'n right away with the pre-configured spinner instance or customize to your hearts content. This package includes features for CLI spinners and progress bars, designed to enhance the user experience of your command-line applications.

Features

  • CLI Spinners: Utilize a variety of spinner styles for asynchronous operations.
  • Progress Bars: Implement customizable progress bars for tracking lengthy processes.
  • Turn-Key Spinner: Singleton spinner instance for the especially lazy amongst us.

Installation

Install via npm:

npm install @basd/spinner

Usage

Spinners

const { Spinner } = require('@basd/spinner')

const spinner = new Spinner({
  id: 'unique-spinner-id', // optional
  color: 'green', // optional
  spinner: 'dots' // optional, spinner style
})

spinner.start('Loading...')
// Update the spinner
spinner.update('Still loading...')
// Complete the spinner
spinner.succeed('Completed!')

Progress Bars

const { Progress } = require('@basd/spinner')

const progressBar = new Progress({
  total: 100, // total value of the progress bar
  preset: 'shades_classic' // optional, style of the progress bar
})

progressBar.start(0)
// Increment the progress
progressBar.increment(10)
// Update the progress bar to a specific value
progressBar.update(50)
// Complete the progress
progressBar.stop()

Documentation

Tests

In order to run the test suite, simply clone the repository and install its dependencies:

git clone https://github.com/basedwon/spinner.git
cd spinner
npm install

To run the tests:

npm test

Contributing

Thank you! Please see our contributing guidelines for details.

Donations

If you find this project useful and want to help support further development, please send us some coin. We greatly appreciate any and all contributions. Thank you!

Bitcoin (BTC):

1JUb1yNFH6wjGekRUW6Dfgyg4J4h6wKKdF

Monero (XMR):

46uV2fMZT3EWkBrGUgszJCcbqFqEvqrB4bZBJwsbx7yA8e2WBakXzJSUK8aqT4GoqERzbg4oKT2SiPeCgjzVH6VpSQ5y7KQ

License

@basd/spinner is MIT licensed.

spinner's People

Contributors

basedwon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.