# @florajs/request-parser

> Request parser for Flora

Latest version **5.0.2** (published 2026-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @florajs/request-parser
pnpm add @florajs/request-parser
yarn add @florajs/request-parser
bun add @florajs/request-parser
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 5.0.2 |
| Published | 2026-08-18 |
| First published | 2022-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 2 |
| Unpacked size | 37.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | stock3 AG |
| Maintainers | nicokaiser, mbaumgartl, not-implemented |
| Keywords | florajs |

## Links

- npm: https://www.npmjs.com/package/@florajs/request-parser
- Repository: https://github.com/florajs/request-parser
- Issues: https://github.com/florajs/request-parser/issues
- npm.io page: https://npm.io/package/@florajs/request-parser

## Dependencies (2)

- [@florajs/ql](https://npm.io/package/@florajs/ql.md) ^6.1.1
- [@florajs/errors](https://npm.io/package/@florajs/errors.md) ^4.0.0

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 5.0.2 (latest) — 2026-08-18
- 5.0.1 — 2025-04-22
- 5.0.0 — 2024-08-13
- 4.0.0 — 2023-08-03
- 3.1.0 — 2023-08-02
- 3.0.0 — 2022-01-04

## README

# @florajs/request-parser

![](https://github.com/florajs/request-parser/workflows/ci/badge.svg)
[![NPM version](https://img.shields.io/npm/v/@florajs/request-parser.svg?style=flat)](https://www.npmjs.com/package/@florajs/request-parser)
[![NPM downloads](https://img.shields.io/npm/dm/@florajs/request-parser.svg?style=flat)](https://www.npmjs.com/package/@florajs/request-parser)

Parse [Flora](https://github.com/florajs/flora) requests into the internal object format.

## Usage

```js
const { parse } = require('@florajs/request-parser');

parse({
    id: 42,
    limit: 100,
    page: 10,
    order: 'lastname:asc',
    search: 'foo',
    select: 'id,firstname,lastname,address[street,zip]',
    filter: 'address.zip=1234',
});
```

### Order syntax

```
lastname:asc
lastname:desc
firstname:asc,lastname:desc
:random
```

### Select syntax

Simple attributes:

```
firstname,lastname
```

Children attributes:

```
firstname,lastname,address.street,address.zip
firstname,lastname,address[street,zip]
```

Additional parameters for children:

```
address(filter=active=true AND zip>10000)[street,zip]
subscriptions(filter=active=true)(order=createdAt:desc)[id,name,product.id]
```

### Filter syntax

Filter by single attribute:

```
type.id=1
```

Filter by multiple values (OR):

```
type.id=1,2,3
```

Filter by multiple attributes (AND):

```
type.id=1 AND categories.id=2
```

Filter by multiple attributes (OR):

```
type.id=1 OR categories.id=2
```

Complex examples with parenthesis:

```
(type.id=1,2,3 OR countries.id=3,23) AND categories.id=2,65'
```

Ranges (10 <= foo <= 20):

```
foo=10..20
```

## License

[MIT](LICENSE)

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