npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tsc-output-format

v1.1.1

Published

Format Typescript compiler (tsc) diagnostic output into JSON, GHA Annotations, and more

Readme

tsc-output-format

Format Typescript compiler (tsc) diagnostic output into JSON, Github Actions Annotation and more.

License NPM Latest NPM Downloads NPM Min Size

CI CodeQL Codecov Type Coverage

  • Supports CLI and programmatic use: Use it directly from the command line for quick compile and formatting, or integrate it into your workflows programmatically.
  • TSC command friendly: Works with the existing tsc CLI options.
  • Works on Pretty Mode: Works with --pretty flag enabled.
  • Supports Watch Mode: Use it directly from the command line to enable watch mode.
  • GitHub-Action Output: Format into GitHub-Action annotations for more visible and actionable error reporting in CI-environment.
  • JSON Output: Format into a structured JSON format for easy integration with other tools or workflows.
  • Customizable: Leverage the Formatter and Parser blueprint to create custom formatter and parser.

Format Example

From:

src/index.ts(1,1): error TS1000: Unexpected Error.

1  const unexpected_error = unexpected_error;
                            ~~~~~~~~~~~~~~~~
                            
src/index2.ts:1:1 - error TS1000: Unexpected Error.

1  const unexpected_error = unexpected_error;
                            ~~~~~~~~~~~~~~~~

To GHA annotations:

::error title=TS Diagnostic (TS1000),file=src/index.ts,line=1,endLine=1,col=1::Unexpected Error.
::error title=TS Diagnostic (TS1000),file=src/index2.ts,line=1,endLine=1,col=1::Unexpected Error.

To JSON Pretty:

[
  {
    "file": "src/index.ts",
    "line": "1",
    "column": "1",
    "errorCode": "TS1000",
    "message": "Unexpected Error",
    "source": "1  const unexpected_error = unexpected_error;\n                            ~~~~~~~~~~~~~~~~",
    "sourceClean": "const unexpected_error = unexpected_error;"
  },
  {
    "file": "src/index2.ts",
    "line": "2",
    "column": "2",
    "errorCode": "TS1000",
    "message": "Unexpected Error",
    "source": "1  const unexpected_error = unexpected_error;\n                            ~~~~~~~~~~~~~~~~",
    "sourceClean": "const unexpected_error = unexpected_error;"
  }
]

To Grouped:

src/index.ts: found 1 errors.
  src/index.ts(1,1): error TS1000: Unexpected Error.

  1  const unexpected_error = unexpected_error;
                              ~~~~~~~~~~~~~~~~

src/index2.ts: found 1 errors.
  src/index.ts:1:1 - error TS1000: Unexpected Error.

  1  const unexpected_error = unexpected_error;
                              ~~~~~~~~~~~~~~~~

To Grouped Minify:

src/index.ts: found 1 errors.
src/index2.ts: found 1 errors.

To Suppressed:

suppressed 2 tsc errors.

Installation

# NPM
npm install --save-dev tsc-output-format

# BUN
bun add -d tsc-output-format

Usage

CLI

CLI Options

  • --formatOnly: boolean
  • --formatOutput: raw | gha | grouped | groupedMin | json | jsonPretty | suppressed
  • Other tsc cli options, such as:
    • --watch
    • --noEmit
    • etc.

Compile and Format

# NODE
npx tsc-output-format --formatOutput=json

# BUN
bunx tsc-output-format --formatOutput=json

use -w or --watch flag for watch-mode.

# NODE
npx tsc-output-format --formatOutput=json --watch

# BUN
bunx tsc-output-format --formatOutput=json --watch

Format Only

# NODE
npx -p typescript tsc | npx tsc-output-format --formatOnly --formatOutput=json

# BUN
bunx tsc | bunx tsc-output-format --formatOnly --formatOutput=json

use -w or --watch flag for watch-mode.

# NODE
npx -p typescript tsc --watch | npx tsc-output-format --formatOnly --formatOutput=json --watch

# BUN
bunx tsc --watch | bunx tsc-output-format --formatOnly --formatOutput=json --watch

Parse only

Not available with CLI.

Custom

Not available with CLI.

Programmatically

Compile and Format

Not available programmatically.

Format Only

import { Formatter } from "tsc-output-format";

const errors = `src/index.ts(1,1): error TS1000: Unexpected error.`;

const gha = Formatter.ghaFormatter.format(errors);
const json = Formatter.jsonFormatter.format(errors);
const jsonPretty = Formatter.jsonPrettyFormatter.format(errors);
const grouped = Formatter.groupedFormatter.format(errors);
const groupedMin = Formatter.groupedMinFormatter.format(errors);
const suppressed = Formatter.suppressedFormatter.format(errors);

// do anything with all outputs...

Parse only

import { Parser } from "tsc-output-format";

const errors = `src/index.ts(1,1): error TS1000: Unexpected error.`;

const _default = Parser.defaultParser.parse(errors);

// do anything with parse result...

Custom

import { Blueprint } from "tsc-output-format";

const errors = `
src/index.ts(1,1): error TS1000: Unexpected error.
src/index.ts(2,1): error TS1001: Unknown error.
`;

const errorCodeParser = new Blueprint.Parser(/^.*(TS\d+).*$/gm, ['errorCode']);
const errorCodeFormatter = new Blueprint.Formatter(errorCodeParser, (parseResults) => {
  return JSON.stringify(parseResults.map(result => result.errorCode));
})

const errorCodeList = errorCodeFormatter.format(errors); // [TS1000, TS1001]

Developed With

  • Typescript - Strongly typed programming language that builds on JavaScript.
  • Bun - All-in-one JavaScript runtime & toolkit designed for speed, complete with a bundler, test runner, and Node.js-compatible package manager.

License

The code in this project is released under the MIT License.