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 · Oct 18, 2026

@typesugar/prettier-plugin has 2 recorded weekly downloads on npm, a decrease of 75.0% over the past 30 days, ranking #2285 of 2,322 tracked listings.

Weekly downloads
2
Official API · Oct 18, 2026
7-day growth
—
Insufficient history
30-day growth
-75.0%
-6 weekly downloads
90-day growth
-60.0%
-3 weekly downloads
Rank
#2285
Among tracked npm listings

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: 2 weekly downloads as of Oct 18, 2026, -60.0% over 90 days.@typesugar/prettier-pluginWeekly downloads on npm · Last 90 days2downloads / week-60.0% over 90 days024681012Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
@typesugar/prettier-plugin weekly downloads on npm, last 90 days: 2 weekly downloads as of Oct 18, 2026, -60.0% over 90 days.

7/30/90-day growth

@typesugar/prettier-plugin weekly downloads growth on npm: 7-day growth unavailable, -75.0% over 30 days, -60.0% over 90 days.@typesugar/prettier-pluginWeekly downloads growth on npm2downloads / week now7-day growth+2 weekly downloadsInsufficient history30-day growth-6 weekly downloads-75.0%90-day growth-3 weekly downloads-60.0%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
@typesugar/prettier-plugin weekly downloads growth on npm: 7-day growth unavailable, -75.0% over 30 days, -60.0% over 90 days.

Ranking history

@typesugar/prettier-plugin npm ranking history: currently #2285 (by weekly downloads).@typesugar/prettier-pluginnpm ranking · by weekly downloads · Last 90 days#2285current rank#2210#2220#2230#2240#2250#2260#2270#2280#2290Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
@typesugar/prettier-plugin npm ranking history: currently #2285 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,161 shown · page 115, #9 (overall #2,289)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins244 listings · 13 pages · page 12, #3 (overall #223)
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 (122)
Recent weekly downloads observations for @typesugar/prettier-plugin
Date (UTC)Weekly downloadsChange vs. previous
2+1
10
10
10
10
10
1+1
00
00
0-1
10
10
10
1—

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 Oct 20, 2026. See the methodology.