bun-spinners
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Bun Spinners

Simple tool for logging any number of spinners.

Preview

Preview code

See test/index.test.ts.

import { spinners } from "bun-spinners";

const sleep = (ms: number) => new Promise(
  (resolve) => setTimeout(resolve, ms)
);

try {
  await spinners({
    "Starting APU...": async () => {
      await sleep(1000);
    },

    "Starting engines...": async () => {
      await sleep(5000);
      throw "Fuel mixture set to cutoff.";
    },

    "Setting flaps...": async () => {
      await sleep(2000);
    }
  })
} catch (e) {
  await spinners({
    "Aborting takeoff...": async () => {
      await sleep(3000);
    }
  });
}

Readme

Keywords

none

Package Sidebar

Install

npm i bun-spinners

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

217 kB

Total Files

9

Last publish

Collaborators

  • ctjlewis