# @comunica/mediator-number

> A mediator for a single mediation number value

Latest version **5.4.0** (published 2026-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @comunica/mediator-number
pnpm add @comunica/mediator-number
yarn add @comunica/mediator-number
bun add @comunica/mediator-number
```

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.4.0 |
| Published | 2026-09-14 |
| First published | 2018-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 33.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 591 |
| Maintainers | joachimvh, rubensworks, rubenverborgh, dexagod, jeswr |
| Keywords | comunica, runner |

## Links

- npm: https://www.npmjs.com/package/@comunica/mediator-number
- Repository: https://github.com/comunica/comunica
- Homepage: https://comunica.dev/
- Issues: https://github.com/comunica/comunica/issues
- Funding: https://opencollective.com/comunica-association
- npm.io page: https://npm.io/package/@comunica/mediator-number

## Dependencies (1)

- [@comunica/core](https://npm.io/package/@comunica/core.md) ^5.4.0

## Recent versions

- 5.4.0 (latest) — 2026-09-14
- 4.4.2-alpha.49.0 (next) — 2025-10-22
- 5.3.0 — 2026-07-10
- 5.2.3 — 2026-05-26
- 5.2.2 — 2026-05-03
- 5.2.0 — 2026-04-14
- 5.1.3 — 2026-01-30
- 5.1.0 — 2026-01-16
- 5.0.3 — 2026-01-12
- 5.0.2 — 2026-01-12
- 5.0.0 — 2026-01-08
- 4.5.0 — 2025-11-18
- 4.4.0 — 2025-09-17
- 4.2.0 — 2025-04-29
- 4.1.0 — 2025-02-11
- … 96 more at https://npm.io/package/@comunica/mediator-number/versions

## README

# Comunica Number Mediator

[![npm version](https://badge.fury.io/js/%40comunica%2Fmediator-number.svg)](https://www.npmjs.com/package/@comunica/mediator-number)

A mediator that can mediate over a single number field.
It can either choose the actor with the maximum or with the minimum value.

This module is part of the [Comunica framework](https://github.com/comunica/comunica),
and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).

[Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).

## Install

```bash
$ yarn add @comunica/mediator-number
```

## Configure

After installing, this mediator can be instantiated as follows:
```text
{
  "@context": [
    ...
    "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/mediator-number/^5.0.0/components/context.jsonld"
  ],
  "actors": [
    ...
    {
      "@type": "SomeActor",
      "someMediator": {
        "@id": "#mediatorQueryOperation",
        "@type": "MediatorNumber",
        "field": "httpRequests",
        "type": "min",
        "ignoreErrors": true,
        "bus": { "@id": "ActorQueryOperation:_default_bus" }
      }
    }
  ]
}
```

Instead of `MediatorNumberMin`, `MediatorNumberMax` could also be used to resolve to the maximum value.

### Config Parameters

* `bus`: Identifier of the bus to mediate over.
* `field`: The field name to mediate over.
* `type`: The way how the index should be selected. For choosing the minimum value: 'min'. For choosing the maximum value: 'max'.
* `ignoreErrors`: Optional flag to indicate if actors that throw test errors should be ignored, defaults to false.

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