# least-recently-record

> Least Recently Map/Set, make every add/set will at end of entries

Latest version **1.0.2** (published 2021-07-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install least-recently-record
pnpm add least-recently-record
yarn add least-recently-record
bun add least-recently-record
```

## 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.2 |
| Published | 2021-07-03 |
| First published | 2020-08-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bluelovers |
| Maintainers | bluelovers |
| Keywords | set, map, record, entries, mru, lru, cache |

## Links

- npm: https://www.npmjs.com/package/least-recently-record
- Repository: https://github.com/bluelovers/ws-lru
- Homepage: https://github.com/bluelovers/ws-lru/tree/master/packages/least-recently-record#readme
- Issues: https://github.com/bluelovers/ws-lru/issues
- npm.io page: https://npm.io/package/least-recently-record

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-07-03
- 1.0.1 — 2020-08-17

## README

# README.md

    Least Recently Map/Set, make every add/set will at end of entries

## install

```bash
yarn add least-recently-record
yarn-tool add least-recently-record
yt add least-recently-record
```

```ts
import { LeastRecentlyMap } from '../map';
import LeastRecentlySet from '../set';

test(`LeastRecentlyMap`, () =>
{
	let data = new LeastRecentlyMap();

	data.set(2, 2)
	data.set(1, 1)

	console.dir(data)

	let actual = [...data.entries()];
	let actual2 = [...data.keys()];

	expect(actual).toStrictEqual([[2, 2], [1, 1]]);
	expect(actual2).toStrictEqual([2, 1]);

	data.set(2, 2)

	actual = [...data.entries()];
	actual2 = [...data.keys()];

	expect(actual).toStrictEqual([[1, 1], [2, 2]]);
	expect(actual2).toStrictEqual([1, 2]);

	expect(data).toMatchSnapshot();

});

test(`LeastRecentlySet`, () =>
{
	let data = new LeastRecentlySet();

	data.add(2)
	data.add(1)

	console.dir(data)

	let actual = [...data.entries()];
	let actual2 = [...data.keys()];

	expect(actual).toStrictEqual([[2, 2], [1, 1]]);
	expect(actual2).toStrictEqual([2, 1]);

	data.add(2)

	actual = [...data.entries()];
	actual2 = [...data.keys()];

	expect(actual).toStrictEqual([[1, 1], [2, 2]]);
	expect(actual2).toStrictEqual([1, 2]);

	expect(data).toMatchSnapshot();

});
```

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