Skip to content
PluginStats

@typesugar/prettier-plugin weekly downloads statistics

By typesugar · npm · Prettier plugins

🧊 Prettier plugin for typesugar custom syntax (|>, ::, F<_>)

View on npm Fresh · Dec 6, 2026

@typesugar/prettier-plugin has 12 recorded weekly downloads on npm, an increase of 140% over the past 30 days, ranking #3106 of 3,247 tracked listings.

Weekly downloads
12
Official API · Dec 5, 2026
7-day growth
+20.0%
+2 weekly downloads
30-day growth
+140%
+7 weekly downloads
90-day growth
+50.0%
+4 weekly downloads
Rank
#3106
▼ 150 in 7 days

About @typesugar/prettier-plugin

@typesugar/prettier-plugin

Prettier plugin for typesugar custom syntax (|>, ::, F<_>).

Installation

npm install --save-dev @typesugar/prettier-plugin

Quick Start

Add the plugin to your Prettier configuration:

{
  "plugins": ["@typesugar/prettier-plugin"]
}

That's it — Prettier will now handle typesugar files without crashing on custom syntax.

Two Layers of Formatting

Layer 1: Plugin (Don't Crash)

The Prettier plugin preprocesses custom syntax before Prettier parses it. This prevents parse errors on |>, ::, and F<_> syntax. The formatted output is valid TypeScript but contains preprocessor artifacts (__binop__, Kind<F, A>).

Use this when you just need Prettier to work — e.g., in CI format checks or editor integration.

{
  "plugins": ["@typesugar/prettier-plugin"]
}
Layer 2: Full Round-Trip Format (Preserve Custom Syntax)

The format() function does a complete round-trip: custom syntax is preprocessed, Prettier formats the valid TypeScript, then custom syntax is restored.

import { format } from "@typesugar/prettier-plugin";

const source = `const x = data |> filter(pred) |> map(fn);`;
const formatted = await format(source, { filepath: "example.ts" });
// formatted: `const x = data |> filter(pred) |> map(fn);` (properly formatted)

The pipeline:

  1. preFormat — Converts |> to __binop__(), F<_> to Kind<F, A>, etc.
  2. prettier.format — Formats the valid TypeScript
  3. postFormat — Restores __binop__() back to |>, Kind<F, A> back to F<A>, etc.

CLI

A standalone formatter CLI is included:

# Format files in place
typesugar-fmt src/**/*.ts

# Check formatting (CI mode — exits 1 if any file needs formatting)
typesugar-fmt --check src/**/*.ts
CLI Options
OptionDescription
--writeWrite formatted output to files (default)
--checkCheck if files are formatted
--helpShow help message

Supported extensions: .ts, .tsx, .mts, .cts

Plugin Options

The plugin adds one custom option to Prettier:

OptionTypeDefaultDescription
typesugarSkipbooleanfalseSkip typesugar preprocessing
{
  "plugins": ["@typesugar/prettier-plugin"],
  "typesugarSkip": false
}

Programmatic API

format(source, options?)

Full round-trip formatting with custom syntax preservation.

import { format } from "@typesugar/prettier-plugin";

const formatted = await format(source, {
  filepath: "example.ts",
  prettierOptions: { printWidth: 100 },
});
check(source, options?)

Check if a file would change when formatted. Returns true if formatting is needed.

import { check } from "@typesugar/prettier-plugin";

const needsFormat = await check(source, { filepath: "example.ts" });
preFormat(source, options?)

Convert custom syntax to valid TypeScript (step 1 only). Returns the processed code and metadata needed by postFormat.

import { preFormat } from "@typesugar/prettier-plugin";

const { code, changed, metadata } = preFormat(source, { fileName: "example.ts" });
postFormat(formatted, metadata)

Restore custom syntax from preprocessed TypeScript (step 3 only). Requires the metadata from preFormat.

import { postFormat } from "@typesugar/prettier-plugin";

const restored = postFormat(formattedCode, metadata);
getFormatMetadata(source, options?)

Get format metadata without actually formatting. Useful for debugging.

import { getFormatMetadata } from "@typesugar/prettier-plugin";

const metadata = getFormatMetadata(source, { filepath: "example.ts" });

Integration with Other Packages

  • @typesugar/preprocessor — The plugin uses the preprocessor internally for syntax transformations
  • @typesugar/eslint-plugin — The ESLint plugin handles linting; this plugin handles formatting
  • @typesugar/vscode — The VS Code extension integrates both formatting and linting

How It Works

typesugar introduces syntax that isn't valid TypeScript (|>, ::, F<_>). Prettier's TypeScript parser chokes on these. This plugin intercepts parsing via a custom parser that preprocesses the source first.

The custom parser (typesugar-ts) extends Prettier's built-in TypeScript parser with a preprocess step that runs the typesugar preprocessor. Prettier sees valid TypeScript and formats it normally.

For the full round-trip format() function, a third step reverses the preprocessing using AST analysis to find __binop__() calls and Kind<F, A> type references, then replaces them with the original custom syntax.

API Quick Reference

ExportTypeDescription
pluginPluginPrettier plugin (default export)
formatFunctionFull round-trip format
checkFunctionCheck if formatting needed
preFormatFunctionCustom syntax → valid TS
postFormatFunctionValid TS → custom syntax
getFormatMetadataFunctionInspect transformations without formatting
FormatOptionsTypeOptions for format/check
PreFormatOptionsTypeOptions for preFormat
FormatMetadataTypeMetadata from preFormat
HKTParamInfoTypeHKT parameter scope info

License

MIT

Description from the npm listing.

  • prettier
  • prettier-plugin
  • typesugar
  • typescript
  • formatting
  • hkt
  • pipeline

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@typesugar/prettier-plugin weekly downloads on npm, last 90 days: 12 weekly downloads as of Dec 5, 2026, +50.0% over 90 days.@typesugar/prettier-pluginWeekly downloads on npm · Last 90 days12downloads / week+50.0% over 90 days02468101214Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@typesugar/prettier-plugin weekly downloads on npm, last 90 days: 12 weekly downloads as of Dec 5, 2026, +50.0% over 90 days.

7/30/90-day growth

@typesugar/prettier-plugin weekly downloads growth on npm: +20.0% over 7 days, +140% over 30 days, +50.0% over 90 days.@typesugar/prettier-pluginWeekly downloads growth on npm12downloads / week now7-day growth+2 weekly downloads+20.0%30-day growth+7 weekly downloads+140%90-day growth+4 weekly downloads+50.0%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@typesugar/prettier-plugin weekly downloads growth on npm: +20.0% over 7 days, +140% over 30 days, +50.0% over 90 days.

Ranking history

@typesugar/prettier-plugin npm ranking history: currently #3106 (by weekly downloads).@typesugar/prettier-pluginnpm ranking · by weekly downloads · Last 90 days#3106current rank#2000#2200#2400#2600#2800#3000#3200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 43 observations · Updated Dec 5, 2026pluginstats.com
@typesugar/prettier-plugin npm ranking history: currently #3106 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 156, #8 (overall #3,108)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 11, #19 (overall #219)
Prettier plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (170)
Recent weekly downloads observations for @typesugar/prettier-plugin
Date (UTC)Weekly downloadsChange vs. previous
12-1
130
13+5
8-1
9+3
60
6-4
10+2
8+1
7+1
60
60
6-1
7—

Similar npm Prettier plugins plugins

All 20 @typesugar/prettier-plugin alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@typesugar/prettier-plugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.