TYPESCRIPT LEGAL CITATION EXTRACTION

Legalcitations,
extracted precisely

Extract, resolve, and annotate legal citations from court opinions and legal documents. Zero dependencies. TypeScript native. 7KB gzipped. ✨ by @claude for @claude ✨

INSTALLnpm install eyecite-ts
View on GitHub
Zero Dependencies
TypeScript Native
MIT Licensed

Try It Live

Paste legal text to extract citations instantly

What eyecite-ts Can Do

Full Citation Extraction

Case citations, statutes, journals, neutral citations, public laws, and federal register.

Parallel Citation Linking

Automatic detection and grouping of comma-separated citations sharing parentheticals.

Short-Form Resolution

Id./Ibid., supra, and short-form case citations resolved to their full antecedents.

1,200+ Reporter Database

Comprehensive reporter database with variant matching and confidence scoring.

Tree-Shakeable Bundle

Optimized exports with lazy-loaded reporter data. 7KB gzipped core bundle.

TypeScript Native

Discriminated unions, conditional types, type guards, and full IntelliSense support.

How eyecite-ts Works

A streamlined 4-stage pipeline transforms raw legal text into structured, linked citations with full metadata.

Zero Dependencies

No runtime dependencies. The entire pipeline is self-contained, resulting in a 7KB gzipped core bundle that's perfect for browser and Node.js environments.

Type-Safe Architecture

Built with TypeScript from the ground up. Discriminated unions, conditional types, and type guards ensure compile-time safety at every stage of the pipeline.

Position Tracking

All spans track both cleaned and original text offsets via TransformationMap, enabling precise annotation and modification of the source document.

Lazy Loading

Reporter database (86.5 KB) is lazy-loaded only when validation is enabled. Core extraction works without loading any external data files.