# @nextgis/properties-filter

> Filtering objects by its properties using expressions

Latest version **4.1.1** (published 2026-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nextgis/properties-filter
pnpm add @nextgis/properties-filter
yarn add @nextgis/properties-filter
bun add @nextgis/properties-filter
```

## Health

**Score 65/100 (B)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2026-11-13 |
| First published | 2020-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 71.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | NextGIS |
| Maintainers | rendrom, maximdubinin, karavanjo |
| Keywords | NextGIS, MAP |

## Links

- npm: https://www.npmjs.com/package/@nextgis/properties-filter
- Repository: https://github.com/nextgis/nextgis_frontend
- Homepage: https://github.com/nextgis/nextgis_frontend/tree/master/packages/properties-filter#readme
- Issues: https://github.com/nextgis/nextgis_frontend/issues
- npm.io page: https://npm.io/package/@nextgis/properties-filter

## Dependencies (2)

- [@nextgis/utils](https://npm.io/package/@nextgis/utils.md) 4.1.1
- [@types/geojson](https://npm.io/package/@types/geojson.md) ^7946.0.14

## Recent versions

- 4.1.1 (latest) — 2026-11-13
- 4.0.2 — 2026-11-05
- 4.0.1 — 2026-11-02
- 4.0.0 — 2026-08-30
- 4.0.0-rc.2 — 2026-08-30
- 4.0.0-rc.1 — 2026-08-29
- 4.0.0-rc.0 — 2026-08-27
- 4.0.0-alpha.8 — 2026-08-25
- 4.0.0-alpha.6 — 2026-08-24
- 4.0.0-alpha.5 — 2026-08-21
- 4.0.0-alpha.2 — 2026-05-28
- 3.0.0 — 2025-07-26
- 3.0.0-alpha.22 — 2025-05-14
- 3.0.0-alpha.17 — 2024-12-24
- 3.0.0-alpha.13 — 2024-10-24
- … 84 more at https://npm.io/package/@nextgis/properties-filter/versions

## README

# Properties Filter

![version](https://img.shields.io/npm/v/@nextgis/properties-filter)

An auxiliary library that allows filtering objects by its properties using JSON-serializable expressions

## Installation

```bash
# latest stable
npm install @nextgis/properties-filter
```

## Usage

General view of expression

`[ С , [E1] , [E2] , [EN] ]`

- С - condition (optional). May be 'all' or 'any';

- E - expression:

  `[key, operator, value]`

  - key - property name;
  - operator - `gt`, `lt`, `ge`, `le`, `eq`, `ne`, `in`, `notin`, `like`, `ilike`;
  - value - anything to compare with property by operator

  `in` and `notin`:

  - [['id', 'in', [1,2,3]], ['id', 'notin', [1,2,3]]]

  `like` and `ilike`:

  Place `%`-character after or before `key` string to determine the direction of search.

  - ['str%', 'like', 'hello']
  - ['%str%', 'ilike', 'Worl']

Nesting

`[ [E1], ['any', [E2], [E3, E4] ], ['any', [E5], [E6] ] ] ]`

Example

```javascript
import { propertiesFilter, featureFilter } from '@nextgis/properties-filter';

const properties = {
  place: 'Tofalaria',
  area: 21,
};

propertiesFilter(properties, [['place', 'eq', 'Tofalaria']]); // true
propertiesFilter(properties, [['place', 'in', ['Tofalaria', 'Siberia']]]); // true
propertiesFilter(properties, [['place%', 'like', 'Tof']]); // true

propertiesFilter(properties, [
  // 'and', // - by default
  ['place', 'eq', 'Tofalaria'],
  ['area', 'ge', 21],
]); // true
propertiesFilter(properties, [
  'any',
  ['place', 'eq', 'Siberia'],
  ['area', 'gt', 10],
]); // true
```

## Commercial support

Need to fix a bug or add a feature to `@nextgis/properties-filter`? We provide custom development and support for this software. [Contact us](http://nextgis.com/contact/) to discuss options!

[![http://nextgis.com](https://nextgis.com/img/nextgis.png)](http://nextgis.com)

---
_Source: https://npm.io/package/@nextgis/properties-filter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
