# @rizzzse/bimap

> A simple and tiny bi-directional map that extends ES2015's Map.

Latest version **1.2.1** (published 2022-07-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rizzzse/bimap
pnpm add @rizzzse/bimap
yarn add @rizzzse/bimap
bun add @rizzzse/bimap
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2022-07-19 |
| First published | 2021-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | rizzzse |
| Maintainers | rizzzse |
| Keywords | map, bimap, bidirectional |

## Links

- npm: https://www.npmjs.com/package/@rizzzse/bimap
- Repository: https://github.com/rizzzse/bimap
- Homepage: https://github.com/rizzzse/bimap#readme
- Issues: https://github.com/rizzzse/bimap/issues
- npm.io page: https://npm.io/package/@rizzzse/bimap

## 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

- 1.2.1 (latest) — 2022-07-19
- 1.2.0 — 2022-03-23
- 1.1.1 — 2021-12-21
- 1.1.0 — 2021-12-20
- 1.0.0 — 2021-12-18

## README

# bimap

A simple and tiny bi-directional map that extends ES2015's Map.
BiMap can be operated with the same interface as Map, and you can get an inverted BiMap with `inverse`.

```ts
// cjs
const { BiMap, WeakBiMap } = require("@rizzzse/bimap");
// esm
import { BiMap, WeakBiMap } from "@rizzzse/bimap";

const bimap = new BiMap([["key", "value"]]);
bimap.get("key");           // === "value"
bimap.inverse.get("value"); // === "key"

bimap.set("key2", "value");
bimap.has("key");           // === false
bimap.get("key2");          // === "value"
bimap.inverse.get("value"); // === "key2"
```

```ts
class MyBiMap<K, V> extends BiMap<K, V> {
    declare readonly inverse: MyBiMap<V, K>;
    myMethod() {
        // ...
    }
}
```

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