Registry / cli-loading-animation

cli-loading-animation

JSON →
library1.0.6jsnpmunverified

A Node.js library that combines cli-spinners and log-update to display terminal loading animations. Current stable version is 1.0.6. Provides a simple API with start/stop functions and supports custom spinners. Differentiators include zero additional dependencies (uses well-established underlying libraries) and TypeScript type definitions included.

npm install cli-loading-animation
INSTALL
IMPORT
SIG · CLI-LOADING-ANIMAT
C
cli-loading-animation
javascriptv1.0.6
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

loading
import { loading } from 'cli-loading-animation'
const loading = require('cli-loading-animation')
Package exports a named function, not a default export.
loading
const { loading } = require('cli-loading-animation')
require('cli-loading-animation').default()
CommonJS destructuring is required.
SpinnerOptions (type)
import type { SpinnerOptions } from 'cli-loading-animation'
TypeScript users should import the type for options.

Shows how to import and use the loading function with a custom message and optional clearing on stop.

import { loading } from 'cli-loading-animation'; const { start, stop } = loading('Processing...', { clearOnEnd: true }); start(); setTimeout(() => { stop(); console.log('Done!'); }, 3000);
Debug
Known issues
deprecatedPackage relies on log-update v4 which uses ansi-escapes. Future versions may change.
fix
Monitor for updates to underlying dependencies.
affects: <=1.0.6
gotchaCalling stop() multiple times will not throw but may cause unexpected behavior if clearOnEnd is true.
fix
Ensure stop() is called only once.
affects: >=1.0.0
gotchaThe loading function returns an object with start and stop. Starting without stopping may leave terminal in inconsistent state.
fix
Always call stop() after use, e.g., in a finally block.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: loading is not a function
Incorrect import: using default import when named import is needed.
fix
Use `import { loading } from 'cli-loading-animation'` or `const { loading } = require('cli-loading-animation')`.
Cannot find module 'cli-loading-animation'
Package not installed or missing from node_modules.
fix
Run `npm install cli-loading-animation` or `yarn add cli-loading-animation`.
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies
cli-spinnersrequiredProvides the spinner frames and intervals.
log-updaterequiredManages terminal line overwriting for animation.
Agent activity
4 hits · last 30 days
node
4
Resources
cli-loading-animation — npm install cli-loading-animation · libregistry