Terminal syntax highlighting
@stackline/cardinal
Preserve Cardinal's compact API and exact ANSI output while gaining reliable streams, named themes, ESM, browser builds, and first-party types.
npm install @stackline/cardinalv1.0.0Node 12+TypeScript 3.9-7.0MIT
Production browser bundle
ANSI highlighter
JavaScript or JSON
0 charactersTerminal preview
Drop-in migration
Keep the old import
An npm alias preserves the package key and existing source while selecting the maintained implementation.
npm install cardinal@npm:@stackline/cardinalconst cardinal = require('cardinal')
console.log(cardinal.highlight(source))Public contract
Three focused methods
| Method | Result | Environment |
|---|---|---|
highlight(code, options?) | ANSI-highlighted source | Node and browser |
highlightFileSync(path, options?) | Highlighted UTF-8 file | Node |
highlightFile(path, options?, callback) | Asynchronous callback | Node |
cdl | File or pipe output | Terminal |
Release evidence
Compatibility is measured
- 179
- upstream assertions
- 23
- targeted regressions
- 700
- differential executions
- 98.78%
- core line coverage
Portable reference
Readable by people and tools
Migration, compatibility, security, licensing, and machine-readable references remain available without client rendering.