@tsmodule/spinners
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

Spinners

Simple tool for logging any number of spinners.

Preview

Preview code

See test/index.test.ts.

import { spinners } from "@tsmodule/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 @tsmodule/spinners

Weekly Downloads

0

Version

0.6.0

License

MIT

Unpacked Size

26.3 kB

Total Files

8

Last publish

Collaborators

  • ctjlewis