{"id":18215,"library":"cli-loading-animation","title":"cli-loading-animation","description":"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.","status":"active","version":"1.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/matheusviegas/cli-loading-animation","tags":["javascript","loader","loading","cli-loader","cli-loading","loading-animation","cli-spinners","typescript"],"install":[{"cmd":"npm install cli-loading-animation","lang":"bash","label":"npm"},{"cmd":"yarn add cli-loading-animation","lang":"bash","label":"yarn"},{"cmd":"pnpm add cli-loading-animation","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides the spinner frames and intervals.","package":"cli-spinners","optional":false},{"reason":"Manages terminal line overwriting for animation.","package":"log-update","optional":false}],"imports":[{"note":"Package exports a named function, not a default export.","wrong":"const loading = require('cli-loading-animation')","symbol":"loading","correct":"import { loading } from 'cli-loading-animation'"},{"note":"CommonJS destructuring is required.","wrong":"require('cli-loading-animation').default()","symbol":"loading","correct":"const { loading } = require('cli-loading-animation')"},{"note":"TypeScript users should import the type for options.","symbol":"SpinnerOptions (type)","correct":"import type { SpinnerOptions } from 'cli-loading-animation'"}],"quickstart":{"code":"import { loading } from 'cli-loading-animation';\n\nconst { start, stop } = loading('Processing...', { clearOnEnd: true });\nstart();\nsetTimeout(() => {\n  stop();\n  console.log('Done!');\n}, 3000);","lang":"typescript","description":"Shows how to import and use the loading function with a custom message and optional clearing on stop."},"warnings":[{"fix":"Monitor for updates to underlying dependencies.","message":"Package relies on log-update v4 which uses ansi-escapes. Future versions may change.","severity":"deprecated","affected_versions":"<=1.0.6"},{"fix":"Ensure stop() is called only once.","message":"Calling stop() multiple times will not throw but may cause unexpected behavior if clearOnEnd is true.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always call stop() after use, e.g., in a finally block.","message":"The loading function returns an object with start and stop. Starting without stopping may leave terminal in inconsistent state.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `import { loading } from 'cli-loading-animation'` or `const { loading } = require('cli-loading-animation')`.","cause":"Incorrect import: using default import when named import is needed.","error":"TypeError: loading is not a function"},{"fix":"Run `npm install cli-loading-animation` or `yarn add cli-loading-animation`.","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'cli-loading-animation'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}