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

1.2.1 • Public • Published

consoleload (buggy now, try later)

NPM version NPM downloads GitHub Sponsors donate button

A fully customizable loading animation package for your Console Logs.

Installation

npm install consoleload

Usage

const cload = require("consoleload");

(async () => {
  let log = cload("Fetching user...", "basicspin");
  //await sleep(2000);
  // Code..
  let log2 = cload("Fetching data...", "basicspin");
  //await sleep(2000);
  // Code..
  log2.stop();
})();

Animations

Name Author Frames Spacing
basicspin(default) @ReXulEc ["-", "\", "|", "/"] default
plusminus @ReXulEc ["+", "-"] default
moon @ReXulEc ["🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"] default
weather @ReXulEc ["🌤️", "🌧️", "⛈️", "🌨️", "🌩️", "🌦️"] 2

Options

cload(text, animationName || customAnimation, customFps, customSpace)

You can use these options like this:

(async () => {
  const MyAnimation = {
    fps: 5,
    frames: [
      "/",
      "-",
      "\\",
      "-"
    ],
  }
  let log = cload("Loading with custom animation with 5fps and 5 space..", MyAnimation, null, 5);
  await sleep(5000);
  log.stop();
})();

Output:

Output

Contribute

You can create pr to add your own json. Just dont forget to add animation's name to types.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i consoleload

      Weekly Downloads

      5

      Version

      1.2.1

      License

      ISC

      Unpacked Size

      7.1 kB

      Total Files

      10

      Last publish

      Collaborators

      • rexulec