tiny-spin
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

tiny-spin

A tiny, zero-dependency CLI spinner

Try it out

When you want a CLI spinner in just a few bytes. Installation:

npm i tiny-spin

or

yarn add tiny-spin

Usage:

// CommonJS
const { spin } = require("tiny-spin");
 
const stop = spin("Doing stuff");
 
// Do stuff
 
stop();
// ESM
 
import { spin } from "tiny-spin";
 
const stop = spin("Doing stuff");
 
// Do stuff
 
stop();

API

spin(message, frames, interval)

  • message: the message displayed after the spinner. Default empty
  • frames: an array of strings that are the frames displayed by the spinner. Default ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
  • interval: the interval between frames. Default 80ms.

Returns a function that you call to stop the spinner.

Author: Matt Kane. MIT licence.

Readme

Keywords

none

Package Sidebar

Install

npm i tiny-spin

Weekly Downloads

663

Version

1.0.2

License

MIT

Unpacked Size

1.93 kB

Total Files

5

Last publish

Collaborators

  • ascorbic