# expiring_map

> An extension to es6 Maps that allows for map-level and key-level expiration times

Latest version **1.0.1** (published 2021-04-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install expiring_map
pnpm add expiring_map
yarn add expiring_map
bun add expiring_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.1 |
| Published | 2021-04-19 |
| First published | 2016-10-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tyler Murphy |
| Maintainers | tyler-murphy |
| Keywords | map, es6, expire, expiration, timeout, time, limit |

## Links

- npm: https://www.npmjs.com/package/expiring_map
- Repository: https://github.com/Tyler-Murphy/expiring-map
- Homepage: https://github.com/Tyler-Murphy/expiring-map#readme
- Issues: https://github.com/Tyler-Murphy/expiring-map/issues
- npm.io page: https://npm.io/package/expiring_map

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-04-19
- 1.0.0 — 2016-10-12

## README

[![Build Status](https://travis-ci.org/Tyler-Murphy/expiring-map.svg?branch=master)](https://travis-ci.org/Tyler-Murphy/expiring-map)

### Install

```
npm install --save expiring_map
```

### Use

Provide an expiration time, in milliseconds, to the constructor. Expiration times can also be provided for each `set` call. If there's no expiration time, the entry will never expire.

```js
const ExpiringMap = require('expiring_map').ExpiringMap

let map = new ExpiringMap(3000)
map.set(1, 1)  // will expire after 3 seconds
map.set(2, 2, 1000)  // will expire after 1 second

let map2 = new ExpiringMap()
map2.set(1, 1)  // will never expire
```

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