prettier-plugin-xquery weekly downloads statistics
By DrRataplan · npm · Prettier plugins
Prettier plugin for XQuery files
prettier-plugin-xquery has 534 recorded weekly downloads on npm, an increase of 89.4% over the past 30 days, ranking #2243 of 3,247 tracked listings.
About prettier-plugin-xquery
Prettier for XQuery
prettier-plugin-xquery is a prettier plugin for XQuery. prettier is an
opinionated code formatter that supports multiple languages and integrates with most editors. The
idea is to eliminate discussions of style in code review and allow developers to get back to
thinking about code design instead.
Demo
A demo page lives at xquery.elliat.nl.
Getting started
To run prettier with the XQuery plugin, you're going to need
node.
If you're using the npm CLI, then add the plugin by:
npm install --save-dev prettier prettier-plugin-xquery
Or if you're using yarn, then add the plugin by:
yarn add --dev prettier prettier-plugin-xquery
The prettier executable is now installed and ready for use:
npx prettier --plugin=prettier-plugin-xquery --write '**/*.xq*'
Add a .prettierrc.js to save the configuration
import prettierPluginXQuery from 'prettier-plugin-xquery';
/**
* @type {import('prettier').Config}
*/
const config = {
useTabs: true,
printWidth: 120,
plugins: [prettierPluginXQuery],
};
export default config;
Configuration
| API Option | CLI Option | Default | Description |
|---|---|---|---|
printWidth | --print-width | 80 | Same as in Prettier (see prettier docs). |
tabWidth | --tab-width | 2 | Same as in Prettier (see prettier docs). |
singleQuote | --single-quote | false | Same as in Prettier (see prettier docs). |
useTabs | --use-tabs | false | Same as in Prettier (see prettier docs). |
Any of these can be added to your existing prettier configuration file. For example:
{
"tabWidth": 4,
"plugins": ["prettier-plugin-xquery"]
}
Or, they can be passed to prettier as arguments:
prettier --plugin=prettier-plugin-xquery --tab-width 4 --write '**/*.xq*'
Ignoring
A prettier-ignore comment marks code as ignored for formatting. Like this:
module namespace el = "http://www.elliat.nl";
declare function el:reverse (
$a as xs:integer,
$b as xs:integer,
$c as xs:integer,
$d as xs:integer
) {
($d, $c, $b, $a)
};
(: prettier-ignore :)
declare function el:swap (
$a as xs:integer, $b as xs:integer,
$c as xs:integer, $b as xs:integer
) {
($b, $a, $d, $c)
};
Dialects
The following different extensions to XQuery will be picked up and formatted:
- The update node syntax in Exist DB:
update insert element div {} into /, sponsored by ExistSolutions - XQuery Update Facility 3.0:
insert node element div {} into /
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/drrataplan/prettier-plugin-xquery.
This plugin is under development, the following features are planned:
- Extensible parsers, for the different dialects of XQuery, like the customizations in MarkLogic
- General stability. Refer to list of known test failures for a report of current known failing tests.
License
The package is available as open source under the terms of the MIT License.
Credits
This project uses the rex parser generator to parse XQuery.
Description from the npm listing.
- prettier
- prettier-plugin
- xquery
- xpath
- xml
- formatter
- code-formatter
- fonto
- exist-db
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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)Similar npm Prettier plugins plugins
All 20 prettier-plugin-xquery alternativesData 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/prettier-plugin-xquery. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.