cli-spinners is a JavaScript/TypeScript library that provides a comprehensive collection of over 70 distinct, pre-defined terminal spinners. Each spinner entry includes a recommended `interval` (in milliseconds) for frame display and an array of Unicode `frames` that constitute the animation sequence. The package's current stable version is 3.4.0, and it maintains an active release cadence, frequently adding new spinner designs. Its primary role is to serve as a data source for spinner animations, differentiating it from full-fledged terminal animation libraries like `ora`, which consume `cli-spinners`' data to render actual progress indicators. This design choice makes it highly flexible, as the underlying `spinners.json` file can be directly utilized in various environments and programming languages, with official ports existing for Python, Swift, Rust, Go, and Bash.
npm install cli-spinnersVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import the default `cliSpinners` object and `randomSpinner`, retrieve spinner data, and provides a basic manual animation loop for illustrative purposes (though `ora` is recommended for actual terminal animation).
Ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json` or using `.mjs` file extension) and use `import cliSpinners from 'cli-spinners';` for imports.
Upgrade your Node.js environment to version 18.x or newer.
For actual animated spinners, install and use `ora` (e.g., `npm install ora`) which consumes `cli-spinners` internally. For custom animation, use `setInterval` and `process.stdout.write` with the spinner's frames and interval.
Test the chosen spinners in your target terminal environments. Consider offering a fallback or simpler spinner for environments with limited Unicode support, or advising users on suitable terminal fonts.
Refactor your code to use ES Modules (`import`) and ensure your project's `package.json` has `"type": "module"` or use `.mjs` file extensions.
Ensure you are using the correct ESM import syntax: `import cliSpinners from 'cli-spinners';` and accessing properties like `cliSpinners.dots` (it's an object, not a function).
Run `npm install cli-spinners` or `yarn add cli-spinners`. Double-check the spelling in your import statement.
No dependency data recorded yet.