# @truffle/spinners

> CLI spinners singleton

Latest version **0.2.5** (published 2023-09-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @truffle/spinners
pnpm add @truffle/spinners
yarn add @truffle/spinners
bun add @truffle/spinners
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2023-09-07 |
| First published | 2022-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | ^16.20 \|\| ^18.16 \|\| >=20 |
| Dependencies | 1 |
| Unpacked size | 19 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13914 |
| Author | Ben Burns |
| Maintainers | rizedr, joshuafernandes, cliffoo, kevinbluer, gnidan, haltman, eggplantzzz, fainashalts, cds-amal |
| Keywords | compile, ethereum, etherscan, ipfs, solidity, sourcify, verify-source |

## Links

- npm: https://www.npmjs.com/package/@truffle/spinners
- Repository: https://github.com/trufflesuite/truffle
- Homepage: https://github.com/trufflesuite/truffle/tree/master/packages/spinners#readme
- Issues: https://github.com/trufflesuite/truffle/issues
- npm.io page: https://npm.io/package/@truffle/spinners

## Dependencies (1)

- [@trufflesuite/spinnies](https://npm.io/package/@trufflesuite/spinnies.md) ^0.1.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.2.5 (latest) — 2023-09-07
- 0.2.3-hardhat-error.0 (hardhat-error) — 2022-08-25
- 0.2.4 — 2023-06-06
- 0.2.3 — 2022-11-23
- 0.2.2 — 2022-08-24
- 0.2.2-hardhat-error.1 — 2022-08-22
- 0.2.2-hardhat-error.0 — 2022-08-20
- 0.2.1 — 2022-08-17
- 0.2.0 — 2022-04-21
- 0.1.2 — 2022-04-13
- 0.1.1 — 2022-04-08
- 0.1.0 — 2022-04-01

## README

# `@truffle/spinners`

This is used to manage multiple CLI spinners. It is essentially just a wrapper
around the [`spinnies`](https://github.com/jcarpanelli/spinnies) library that
keeps a single instance of the `spinnies` object in module-level scope.

## Usage

### Typical example

```ts
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

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

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

await someLongRunningTask();
spinner.remove();
```

### Text updates

```ts
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!");
}
```

---
_Source: https://npm.io/package/@truffle/spinners · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
