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

@typesugar/ts-plugin

v0.1.0

Published

๐ŸงŠ TypeScript language service plugin for typesugar

Readme

@typesugar/ts-plugin

TypeScript Language Service Plugin for typesugar that enables full IDE support including:

  • Type-aware transformation โ€” Custom syntax (|>, ::, F<_>) and macros are transformed before TypeScript processes the code
  • Accurate diagnostics โ€” Error positions map back to your original source
  • Go-to-definition โ€” Navigate to original source locations, not transformed code
  • Completions โ€” IntelliSense works on both original and generated code
  • Hover info โ€” See type information for original symbols
  • Find references โ€” Find all references to symbols across transformed code

Installation

npm install @typesugar/ts-plugin --save-dev
# or
pnpm add -D @typesugar/ts-plugin

Configuration

Add the plugin to your tsconfig.json:

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@typesugar/ts-plugin",
        "verbose": false,
        "extensions": ["hkt", "pipeline", "cons"]
      }
    ]
  }
}

Options

| Option | Type | Default | Description | | ------------ | ---------- | ----------------------------- | ---------------------------------------------------------------- | | verbose | boolean | false | Enable verbose logging for debugging | | extensions | string[] | ["hkt", "pipeline", "cons"] | Syntax extensions to enable | | legacyMode | boolean | false | Use legacy error-suppression mode instead of full transformation |

Extensions

  • hkt โ€” Higher-kinded type syntax (F<_> โ†’ $<F, A>)
  • pipeline โ€” Pipe operator (a |> f โ†’ f(a))
  • cons โ€” Cons operator (x :: xs โ†’ cons(x, xs))

Legacy Mode

If you encounter issues with the transform-first approach, you can fall back to legacy mode which simply suppresses errors for typesugar syntax:

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@typesugar/ts-plugin",
        "legacyMode": true
      }
    ]
  }
}

Legacy mode is less accurate but more stable. It's recommended as a fallback if you experience problems with the default mode.

VS Code Integration

When using the typesugar VS Code extension, you can configure the plugin via VS Code settings:

{
  "typesugar.useLegacyPlugin": false,
  "typesugar.enableVerboseLogging": false
}

The extension also provides commands for debugging:

  • typesugar: Show Transformed Source โ€” View the transformed code in a diff view

Debugging

If you encounter issues:

  1. Enable verbose logging to see plugin activity
  2. Use "Show Transformed Source" to see what TypeScript is actually processing
  3. Check the TypeScript server log for errors (VS Code: "TypeScript: Open TS Server Log")
  4. Try legacy mode if the transform-first approach causes problems

Architecture

This plugin uses a transform-first architecture:

  1. Preprocessing โ€” Custom syntax is converted to valid TypeScript
  2. Macro expansion โ€” Macros (@derive, comptime, etc.) are expanded
  3. Source mapping โ€” A source map tracks the transformation
  4. Position mapping โ€” IDE features map positions back to original source

The same transformation pipeline is used by:

  • Build tools (via unplugin-typesugar)
  • CLI (via @typesugar/transformer)
  • This language service plugin

This ensures consistent behavior across all tools.