Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@truffle/spinners

Package Overview
Dependencies
Maintainers
9
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@truffle/spinners

CLI spinners singleton

  • 0.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
9
Created
Source

@truffle/spinners

This is used to manage multiple CLI spinners. It is essentially just a wrapper around the spinnies library that keeps a single instance of the spinnies object in module-level scope.

Usage

Typical example

import { Spinner } from "@truffle/spinners";

const spinner = new Spinner("unique-spinner-name", "watch me spin!");

try {
  await someLongRunningTask();
  spinner.succeed("Phew! 😅");
} catch {
  spinner.fail("Whoops, got too dizzy and fell over! 😵");
}

Hide on completion

import { Spinner } from "@truffle/spinners";

const spinner = new Spinner("unique-spinner-name", "Now you see me");

await someLongRunningTask();
spinner.remove();

Text updates

import { Spinner } from "@truffle/spinners";

const spinner = new Spinner("unique-spinner-name", "Reticulating splines...");

try {
  await reticulateSplines();

  spinner.text = "Perturbing Matrices";
  Promise.all(matrices.map(perturb));

  spinner.text = "Charging Ozone Layer";
  await ozoneLayer.charge();

  spinner.succeed();
} catch {
  spinner.fail("Darn it!");
}

Keywords

FAQs

Package last updated on 07 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc