CLI Source Code Preview

JSON →
library 1.1.0 ·javascript
verified May 27, 2026

cli-source-preview is a JavaScript utility designed to render syntax-highlighted source code snippets directly in the command-line interface. It's particularly useful for enhancing error messages or debug outputs by providing relevant code context, complete with line numbers and customizable colorization. The current stable version is 1.1.0. This package offers a focused solution for presenting code in a terminal environment, distinguishing itself by integrating `chalk` for robust ASCII color support. Developers can specify single lines, line ranges, or even precise line/column positions for the preview, with options to control the number of surrounding context lines and the line delimiter. Given its specific utility and the current version, it's maintained to ensure compatibility and address any critical bugs, rather than undergoing frequent feature-driven releases.

total hits 20
actors 7 distinct systems
last hit 2d ago human
MetaBot
4
ByteDance
3
GPTBot
2
Script
1
Search engines
1
Humans
1

top countries 🇩🇪 Germany · 🇺🇸 United States · 🇨🇦 Canada · 🇸🇬 Singapore