# geostyler-cql-parser

> Translates CQL Filters and Geostyler Style Filters

Latest version **4.1.1** (published 2025-08-26) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install geostyler-cql-parser
pnpm add geostyler-cql-parser
yarn add geostyler-cql-parser
bun add geostyler-cql-parser
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2025-08-26 |
| First published | 2019-01-18 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.6.0 |
| Dependencies | 1 |
| Unpacked size | 65.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Maintainers | jansule, annarieger, terrestris-info, marcjansen, kaivolland, dnlkoch, ahennr, buehner, hwbllmnn, lukaslohoff, mholthausen, jorzekowsky, simonseyock, hblitza, jweskamm, bgerber |
| Keywords | geostyler, parser, style, cql |

## Links

- npm: https://www.npmjs.com/package/geostyler-cql-parser
- Repository: https://github.com/geostyler/geostyler-cql-parser
- Homepage: https://github.com/geostyler/geostyler-cql-parser#readme
- Issues: https://github.com/geostyler/geostyler/issues
- Funding: https://opencollective.com/geostyler
- npm.io page: https://npm.io/package/geostyler-cql-parser

## Dependencies (1)

- [geostyler-style](https://npm.io/package/geostyler-style.md) ^10.0.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 4.1.1 (latest) — 2025-08-26
- 4.0.0-beta.7 (beta) — 2024-06-21
- 4.0.0-next.3 (next) — 2024-06-20
- 4.1.0 — 2025-06-13
- 4.0.2 — 2025-03-12
- 4.0.1 — 2025-01-13
- 4.0.0 — 2024-06-25
- 4.0.0-beta.6 — 2024-06-21
- 4.0.0-beta.5 — 2024-06-21
- 4.0.0-beta.4 — 2024-06-21
- 4.0.0-beta.3 — 2024-06-20
- 4.0.0-beta.2 — 2024-06-20
- 4.0.0-beta.1 — 2024-06-20
- 4.0.0-next.2 — 2024-06-19
- 4.0.0-next.1 — 2024-06-18
- … 12 more at https://npm.io/package/geostyler-cql-parser/versions

## README

[![Greenkeeper badge](https://badges.greenkeeper.io/geostyler/geostyler-cql-parser.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.com/geostyler/geostyler-cql-parser.svg?branch=master)](https://travis-ci.com/geostyler/geostyler-cql-parser)
[![Coverage Status](https://coveralls.io/repos/github/geostyler/geostyler-cql-parser/badge.svg?branch=master)](https://coveralls.io/github/geostyler/geostyler-cql-parser?branch=master)

# geostyler-cql-parser
[GeoStyler](https://github.com/geostyler/geostyler/) Translates CQL Filter and Geostyler Style Filters

This is almost a 1on1 transformation from the [OpenLayers v2 CQL Parser](https://github.com/openlayers/ol2/blob/master/lib/OpenLayers/Format/CQL.js)
to TypeScript. Except that it writes Filters in the [GeoStyler Style](https://github.com/geostyler/geostyler-style) format instead of ol styles.

But you can easily transform the GeoStyler Styles to OL3 with the [GeoStyler OpenLayers Parser](https://github.com/geostyler/geostyler-openlayers-parser).
So its just two steps from CQL Filter to OL3 Styles.

## Building the parser

Run `npm run generate` everytime the `cql-parser.js` needs to be updated.

**Important:** Make sure to remove the export of `main` in order to prevent errors that occur when using the parser in the browser. I.e.
following lines should be removed:

```js
exports.main = function commonjsMain (args) {};
if (typeof module !== 'undefined' && require.main === module) {
  exports.main(process.argv.slice(1));
}
```

## <a name="funding"></a>Funding & financial sponsorship

Maintenance and further development of this code can be funded through the
[GeoStyler Open Collective](https://opencollective.com/geostyler). All contributions and
expenses can transparently be reviewed by anyone; you see what we use the donated money for.
Thank you for any financial support you give the GeoStyler project 💞

---
_Source: https://npm.io/package/geostyler-cql-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
