Skip to content

whosramoss/scriptdx

Repository files navigation

logo
scriptdx

Terminal toolkit for colorful logs, loading effects, tables, steps, and CLI output.

Install · Usage · Features

Live demo

How to install

npm install scriptdx

Usage

Import what you need and write to stdout / stderr like any CLI script:

import {
  logSection,
  logSuccess,
  logWarning,
  logError,
  runStep,
  showTable,
} from "scriptdx";

logSection("Deploy", "Example workflow with scriptdx");

await runStep(async () => {
  await new Promise((resolve) => setTimeout(resolve, 500));
}, "Building project");

logSuccess("Build finished");

const table = showTable(
  ["Service", "Port"],
  [
    ["API", "3000"],
    ["Worker", "3001"],
  ],
);
process.stdout.write(`${table}\n`);

logWarning("Dry run only");
logError("Connection refused (example)");

Run the interactive tutorial from the repo:

npm run tutorial

See docs/README.md for copy-paste examples per category (logger, loading, menu, table, validations, font, and more).

Features

Category Highlights
Logger logInfo, logSuccess, logWarning, logError, logColor, color.*
Loading simpleLoading, linearLoading with custom frame strings
Step runStep — async tasks with spinner and success/failure feedback
Spinner createSpinner for manual progress control
Table showTable, showTableWithBorders for aligned terminal tables
Menu runMenuByIndex for numbered CLI menus
Validations hasTool, summarizeToolValidation for dependency checks
System isLinux, isWindows
Font showScriptTitle — large ASCII banner text

About

Terminal toolkit for CLI output

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors