Registry / devops / tsc-output-format

tsc-output-format

JSON →
library1.1.1jsnpmunverified

tsc-output-format v1.1.1 is a TypeScript library and CLI tool that formats tsc diagnostic output into JSON, GitHub Actions annotations, grouped text, and more. Released in March 2025 with monthly updates, it supports pretty mode, watch mode, and custom formatters/parsers. Unlike other tsc output processors, it provides a pluggable architecture and first-class TypeScript types. Minimal bundle size (<5KB) and zero runtime dependencies make it suitable for CI pipelines.

npm install tsc-output-format
INSTALL
IMPORT
SIG · TSC-OUTPUT-FORMAT
T
tsc-output-format
devopsjavascriptv1.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse
import { parse } from 'tsc-output-format'
import parse from 'tsc-output-format'
Named export, not default. ESM-only package.
format
import { format } from 'tsc-output-format'
const { format } = require('tsc-output-format')
Named export. CJS is not supported; use ESM imports.
formatGHA
import { formatGHA } from 'tsc-output-format/formatters'
import { formatGHA } from 'tsc-output-format'
formatGHA is exported from 'tsc-output-format/formatters' subpath, not main entry point.

Parses tsc diagnostic output from a TypeScript compilation and formats it as JSON.

import { parse, format } from 'tsc-output-format'; import { execSync } from 'child_process'; const tscOutput = execSync('npx tsc --noEmit 2>&1', { encoding: 'utf-8' }); const diagnostics = parse(tscOutput); const formatted = format(diagnostics, { formatter: 'json', // or 'gha', 'grouped' }); console.log(formatted); // Output JSON array of diagnostics with file, line, column, errorCode, message.
tsc-output-format --version
Debug
Known issues
gotchaPackage is ESM-only. Using require() or CommonJS will throw a runtime error.
fix
Use import syntax or set { "type": "module" } in package.json.
affects: >=1.0.0
gotchaformatGHA is exported from a subpath, not the main entry.
fix
Import from 'tsc-output-format/formatters'.
affects: >=1.0.0
breakingIn v1.0.0, parse() did not return a 'line' property as number; it was a string. v1.1.0+ may have fixed this, but verify types.
fix
Upgrade to v1.1.1 or cast line to number.
affects: 1.0.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'length')
Passing empty or malformed input to parse().
fix
Ensure tsc output is not empty and is a string. Use parse(String(tscOutput)).
SyntaxError: Named export 'formatGHA' not found. The requested module 'tsc-output-format' is a commonjs module...
Importing formatGHA from the main entry (tsc-output-format) instead of subpath.
fix
import { formatGHA } from 'tsc-output-format/formatters';
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
tsc-output-format — npm install tsc-output-format · libregistry