Skip to content
PluginStats

@sanity/prettier-plugin-groq weekly downloads statistics

By sanity (5 listings) · npm · Prettier plugins

Prettier plugin for formatting GROQ queries

View on npm Fresh · Dec 6, 2026

@sanity/prettier-plugin-groq has 170 recorded weekly downloads on npm, an increase of 25.0% over the past 30 days, ranking #2530 of 3,247 tracked listings.

Weekly downloads
170
Official API · Dec 5, 2026
7-day growth
-58.7%
-242 weekly downloads
30-day growth
+25.0%
+34 weekly downloads
90-day growth
+400%
+136 weekly downloads
Rank
#2530
▼ 322 in 7 days

About @sanity/prettier-plugin-groq

prettier-plugin-groq

Prettier plugin for formatting GROQ (Graph-Relational Object Queries) queries.

Installation

npm install --save-dev prettier-plugin-groq prettier
# or
pnpm add -D prettier-plugin-groq prettier

Usage

Formatting .groq Files

The plugin automatically formats .groq files when loaded:

npx prettier --write "**/*.groq"

Configure in .prettierrc:

{
  "plugins": ["prettier-plugin-groq"],
  "printWidth": 80
}
Formatting Embedded GROQ in JavaScript/TypeScript

To format GROQ queries embedded in JavaScript/TypeScript files, add the embed plugin:

{
  "plugins": ["prettier-plugin-groq", "prettier-plugin-groq/embed"]
}

This formats GROQ in:

  • Tagged template literals: groq..., `defineQuery`...
  • Function calls: defineQuery("..."), defineQuery(...)
// Before formatting
const query = groq`*[_type=="post"]{title,body,"author":author->name}`

// After formatting
const query = groq`*[_type == "post"] { title, body, "author": author->name }`

Examples

Input
*[_type=="article"&&author._ref==$authorId]{title,"authorName":author->name,publishedAt,categories[]->{title,slug}}
Output
*[_type == "article" && author._ref == $authorId] {
  title,
  "authorName": author->name,
  publishedAt,
  categories[]->{ title, slug }
}

GROQ Syntax Notes

The formatter follows GROQ syntax rules:

  • Object keys must be quoted for computed values: { "slug": slug.current }
  • Shorthand is valid when key matches the attribute: { title } (equivalent to { "title": title })
  • Projections after dereference use shorthand: author->{ name }
  • Array traversals use implicit dereference: categories[]->{ title }

WASM Acceleration

For better performance, this plugin can use WASM-compiled Rust for formatting. Initialize WASM at application startup:

import { initWasmFormatter, isWasmFormatterAvailable } from 'prettier-plugin-groq'

// Optional: Initialize WASM for better performance
await initWasmFormatter()

if (isWasmFormatterAvailable()) {
  console.log('Using WASM formatter')
}

When WASM is available, formatting is ~5-10x faster. The plugin automatically falls back to TypeScript formatting if WASM is not available.

Options

This plugin respects standard Prettier options:

OptionDefaultDescription
printWidth80Line width for wrapping
tabWidth2Indentation size
useTabsfalseUse tabs instead of spaces

License

MIT

Description from the npm listing.

  • sanity
  • groq
  • prettier
  • prettier-plugin
  • formatter

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

@sanity/prettier-plugin-groq weekly downloads on npm, last 90 days: 170 weekly downloads as of Dec 5, 2026, +400% over 90 days.@sanity/prettier-plugin-groqWeekly downloads on npm · Last 90 days170downloads / week+400% over 90 days0100200300400500Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@sanity/prettier-plugin-groq weekly downloads on npm, last 90 days: 170 weekly downloads as of Dec 5, 2026, +400% over 90 days.

7/30/90-day growth

@sanity/prettier-plugin-groq weekly downloads growth on npm: -58.7% over 7 days, +25.0% over 30 days, +400% over 90 days.@sanity/prettier-plugin-groqWeekly downloads growth on npm170downloads / week now7-day growth-242 weekly downloads-58.7%30-day growth+34 weekly downloads+25.0%90-day growth+136 weekly downloads+400%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@sanity/prettier-plugin-groq weekly downloads growth on npm: -58.7% over 7 days, +25.0% over 30 days, +400% over 90 days.

Ranking history

@sanity/prettier-plugin-groq npm ranking history: currently #2530 (by weekly downloads).@sanity/prettier-plugin-groqnpm ranking · by weekly downloads · Last 90 days#2530current rank#1600#1800#2000#2200#2400#2600Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
@sanity/prettier-plugin-groq npm ranking history: currently #2530 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 127, #10 (overall #2,530)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 4, #18 (overall #78)
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 @sanity/prettier-plugin-groq
Date (UTC)Weekly downloadsChange vs. previous
170+12
158-192
350-18
368-30
398-6
404+1
403-9
412+5
407+201
206+4
202+7
195+5
190-18
208—

Similar npm Prettier plugins plugins

All 20 @sanity/prettier-plugin-groq 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/@sanity/prettier-plugin-groq. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.