Tiny Spinner is a minimalist CLI spinner library designed to provide visual feedback for asynchronous operations in terminal applications. It aims for simplicity and a small footprint, differentiating itself from more feature-rich alternatives like `ora` by offering a streamlined API. The package is currently at version 2.0.5 and ships with TypeScript types, facilitating its use in modern JavaScript and TypeScript projects. While its release cadence appears measured, with the last update around early 2025, it remains an active project. Its core functionality focuses on starting, updating, and gracefully stopping a spinner with various status messages (success, warning, error).
npm install tiny-spinnerVerified import paths — ran on the pinned version, not inferred.
Demonstrates starting, updating, and gracefully stopping the spinner with success, warning, or error messages based on simulated asynchronous operations.
For CommonJS, use `const Spinner = require('tiny-spinner').default;`. For new projects, prefer ESM with `import Spinner from 'tiny-spinner';` and set `"type": "module"` in your `package.json`.Ensure all logging is performed either before the spinner starts or after it stops. If logging is required mid-spin, you might need to manually stop the spinner, log, and then restart it, or consider a more robust spinner library (e.g., `ora`) that handles this gracefully.
Always ensure that one of the spinner's termination methods is called in all possible code paths (e.g., in `finally` blocks, success callbacks, or error handlers) to properly clean up the terminal line.
Correctly access the default export in CommonJS: `const Spinner = require('tiny-spinner').default;` or `const { default: Spinner } = require('tiny-spinner');`.Either convert your project or file to an ES Module by adding `"type": "module"` to your `package.json` or by using the `.mjs` file extension. Alternatively, for CommonJS, use the `require` syntax: `const Spinner = require('tiny-spinner').default;`.No dependency data recorded yet.