elegant-spinner provides a simple, elegant set of ASCII frames designed for creating visual loading indicators in interactive command-line interface (CLI) applications. The current stable version is 3.0.0. This package itself does not handle the animation logic; rather, it supplies the individual spinner frames that an external utility (like `log-update` or `ora`) can iterate through to create an animated effect. Its release cadence is tied to Node.js compatibility updates and essential maintenance, rather than rapid feature development. A key differentiator is its minimalism, focusing solely on the spinner frames. However, for most use cases requiring a full-fledged animated spinner, the `ora` package is recommended as it bundles `elegant-spinner` and manages the animation loop automatically. It supports modern Node.js environments and is pure ESM since version 3.0.0, with TypeScript definitions available since version 2.0.0.
npm install elegant-spinnerVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import the `elegantSpinner` function and use it with `log-update` to render a basic animated spinner in the terminal, manually updating frames every 50ms and showing a progress percentage.
Migrate your project to use ES modules (`import`/`export`) or use an older version of the package if CommonJS is strictly required.
Upgrade your Node.js runtime to a compatible version.
For full animation, consider using `ora`. If sticking with `elegant-spinner`, you'll need to manually implement the animation loop using tools like `log-update` and `setInterval`.
Ensure your Node.js version meets the requirement for the specific `elegant-spinner` version you are using. For versions 2.x, Node.js 8+ is needed.
Change your import statement from `const elegantSpinner = require('elegant-spinner');` to `import elegantSpinner from 'elegant-spinner';` and ensure your project is configured for ES modules (e.g., `"type": "module"` in package.json).