# ids

> Simple id generation and caching

Latest version **3.0.2** (published 2026-03-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install ids
pnpm add ids
yarn add ids
bun add ids
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2026-03-04 |
| First published | 2014-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 20.12 |
| Dependencies | 0 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Nico Rehwaldt |
| Maintainers | bpmn-io-admin, nikku, barmac, philippfromme, maxtru, skaiir-camunda, vsgoulart, barinali, jarekdanielak, ev-camunda, alekseymanetov, simon-steinruecken-camunda, iso50 |
| Keywords | id, ids, id-generator |

## Links

- npm: https://www.npmjs.com/package/ids
- Repository: https://github.com/bpmn-io/ids
- Homepage: https://github.com/bpmn-io/ids#readme
- Issues: https://github.com/bpmn-io/ids/issues
- npm.io page: https://npm.io/package/ids

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 3.0.2 (latest) — 2026-03-04
- 2.0.1 (next) — 2023-07-17
- 3.0.1 — 2026-02-05
- 3.0.0 — 2026-01-22
- 1.0.5 — 2023-07-16
- 2.0.0 — 2023-07-14
- 1.0.4 — 2023-07-14
- 1.0.3 — 2023-07-12
- 1.0.2 — 2023-07-12
- 1.0.1 — 2023-07-12
- 1.0.0 — 2019-01-14
- 0.2.2 — 2018-05-08
- 0.2.1 — 2018-05-07
- 0.2.0 — 2016-03-16
- 0.1.2 — 2015-12-17
- … 5 more at https://npm.io/package/ids/versions

## README

# ids

[![Build Status](https://github.com/bpmn-io/ids/actions/workflows/CI.yml/badge.svg)](https://github.com/bpmn-io/ids/actions/workflows/CI.yml)

A simple caching id generation utility.

## Usage

```javascript
import { Ids } from 'ids';

const ids = new Ids();

const next = ids.next(); // returns id

ids.claim('f71a81'); // claim id as already existing

ids.assigned('f71a81'); // true if id was already generated / claimed
```


## Get the library

Fetch it via [npm](http://npmjs.org):

```
npm install --save ids
```


## License

Use under the terms of the [MIT license](http://opensource.org/licenses/MIT).

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