cli-step
raw JSON → 1.0.2 verified Sat Apr 25 auth: no javascript maintenance
A Node.js module to create animated CLI step indicators similar to Yarn's output. Version 1.0.2 is the latest stable release; it has no recent updates and appears to be in maintenance mode. Key differentiators: supports emoji step indicators, records execution time, and provides a simple API for start/success/error states. It is a UI-only layer, not a task runner.
Common errors
error ReferenceError: Steps is not defined ↓
cause Missing require('cli-step')
fix
Add const Steps = require('cli-step') at the top of your file.
error TypeError: Steps is not a constructor ↓
cause Using import incorrectly or shadowing variable name
fix
Ensure you use const Steps = require('cli-step') and do not reassign Steps.
error TypeError: step1.success is not a function ↓
cause Calling success() before start()
fix
Call step.start() before step.success() or step.error().
error Cannot find module 'node-emoji' ↓
cause Missing dependency node-emoji
fix
Run npm install node-emoji in your project.
Warnings
gotcha Emitted steps count must match Steps(totalSteps) constructor argument; if you call advance more or fewer times, no validation is performed. ↓
fix Ensure the total passed to Steps matches the number of advance() calls.
deprecated Package last published in 2017 with no updates; modern Node.js versions may have compatibility issues. ↓
fix Consider using oclif/listr or other actively maintained CLI step libraries.
gotcha Emoji names must match node-emoji's list exactly; unknown names throw no error but display as undefined. ↓
fix Use known emoji names from the node-emoji library.
gotcha The step animation uses process.stdout.write directly; it may conflict with other output libraries or piping. ↓
fix Avoid using with other direct stdout writing libraries simultaneously.
gotcha startRecording/stopRecording measure wall-clock time, not CPU time; high system load may skew results. ↓
fix Use process.hrtime.bigint for more accurate measurements if needed.
Install
npm install cli-step yarn add cli-step pnpm add cli-step Imports
- Steps wrong
import Steps from 'cli-step' // ESM not supportedcorrectconst Steps = require('cli-step') - Steps (ESM bundler) wrong
const Steps = require('cli-step').default // incorrect for this packagecorrectimport Steps from 'cli-step' - Step instance methods wrong
Steps.advance() // static method does not existcorrectconst steps = new Steps(5); const step = steps.advance('text', 'emoji').start()
Quickstart
const Steps = require('cli-step');
const steps = new Steps(3);
const step1 = steps.advance('Resolving packages', 'mag').start();
setTimeout(() => { step1.success('Resolved', 'white_check_mark'); }, 200);
const step2 = steps.advance('Fetching', 'truck').start();
setTimeout(() => { step2.success('Fetched', 'white_check_mark'); }, 400);
const step3 = steps.advance('Linking', 'link').start();
setTimeout(() => { step3.success('Linked', 'white_check_mark'); }, 600);