Versioned project notes for @stackline/cardinal 1.0.5. Original attribution is retained in the linked repository.
Migration
Direct Scoped Import
npm remove cardinal
npm install @stackline/cardinal
const cardinal = require('@stackline/cardinal')
No Source Changes
Use npm's alias syntax to keep the historical package name:
npm install cardinal@npm:@stackline/cardinal
Existing code remains unchanged:
const cardinal = require('cardinal')
The same alias works with TypeScript and ESM imports.
Behavioral Notes
- Default highlighting and object themes preserve Cardinal 2.1.1 output.
- Empty input with
linenos: truenow returns an empty string instead of looping indefinitely. - Piped CLI input is grouped by newline rather than operating on transport chunks. This prevents source corruption and duplicate trailing lines.
- Theme strings now work in the library. Existing theme objects are unchanged.
- Modern parser support is opt-in; Esprima remains the default.
- Runtime support starts at Node.js 12.