# counter-map

> a basic map that keeps count of each item you enter and cleans up only when all counters have been deleted

Latest version **1.0.3** (published 2018-10-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install counter-map
pnpm add counter-map
yarn add counter-map
bun add counter-map
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-10-17 |
| First published | 2018-10-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yoni Amishav amishav@gmail.com |
| Maintainers | yonia |
| Keywords | npm, map, hashmap, counter |

## Links

- npm: https://www.npmjs.com/package/counter-map
- npm.io page: https://npm.io/package/counter-map

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-10-17
- 1.0.2 — 2018-10-14
- 1.0.1 — 2018-10-14
- 1.0.0 — 2018-10-14

## README

Counting Map

A basic map that keeps count of each unique item you set and cleans up only when all counters have been deleted.


Examples:
```
 const counter = new CountingMap();
 counter.set('key', 'value');
```

Adding and removing:
```
    counter.set('key', 'value');
    counter.set('key', 'value');
    counter.delete('key');
```
This example will keep one instance of key in the map
If we run another delete:
```
    counter.delete('key');
```
no items with key 'key' are in the map

Only updating with no incrementing:
```
    const counter = new CountingMap();
    counter.set('key', 'value');
    counter.update('key', 'value1');
```

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