# catbox-memory

> Memory adapter for catbox

Latest version **4.0.1** (published 2018-11-03) · BSD-3-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install catbox-memory
pnpm add catbox-memory
yarn add catbox-memory
bun add catbox-memory
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2018-11-03 |
| First published | 2014-03-02 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | separate (@types/catbox-memory) |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 33 |
| Maintainers | cjihrig, hueniverse, marsup, nlf, wyatt |
| Keywords | cache, catbox, memory |

## Links

- npm: https://www.npmjs.com/package/catbox-memory
- Repository: https://github.com/hapijs/catbox-memory
- Homepage: https://github.com/hapijs/catbox-memory#readme
- Issues: https://github.com/hapijs/catbox-memory/issues
- npm.io page: https://npm.io/package/catbox-memory

## Dependencies (2)

- [boom](https://npm.io/package/boom.md) 7.x.x
- [hoek](https://npm.io/package/hoek.md) 6.x.x

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

- 4.0.1 (latest) — 2018-11-03
- 2.1.1 (v2-legacy) — 2024-01-03
- 3.1.4 (lts) — 2018-11-03
- 3.1.3 — 2018-11-01
- 4.0.0 — 2018-11-01
- 3.1.2 — 2018-03-31
- 3.1.1 — 2017-11-03
- 3.1.0 — 2017-11-03
- 3.0.0 — 2017-09-26
- 2.0.4 — 2016-10-26
- 2.0.3 — 2016-06-07
- 2.0.2 — 2016-05-19
- 2.0.1 — 2015-11-02
- 2.0.0 — 2015-10-31
- 1.1.2 — 2015-08-18
- … 8 more at https://npm.io/package/catbox-memory/versions

## README

catbox-memory
=============

Memory adapter for [catbox](https://github.com/hapijs/catbox).
This adapter is not designed to share a common cache between multiple processes (e.g. in a cluster
mode). It uses a single interval timeout to look for expired records and clean them from memory.

Lead Maintainer - [Wyatt Preul](https://github.com/geek)

Current version: [![Current Version](https://img.shields.io/npm/v/catbox-memory.svg)](https://www.npmjs.org/package/catbox-memory) [![Build Status](https://api.travis-ci.org/hapijs/catbox-memory.svg)](https://travis-ci.org/hapijs/catbox-memory)

### Options

- `maxByteSize` - sets an upper limit on the number of bytes that can be stored in the
  cache. Once this limit is reached no additional items will be added to the cache
  until some expire. The utilized memory calculation is a rough approximation and must
  not be relied on. Defaults to `104857600` (100MB).
- `minCleanupIntervalMsec` - the minimum number of milliseconds in between each cache cleanup.
  Defaults to 1 second (`1000`).
- `allowMixedContent` - by default, all data is cached as JSON strings, and converted
  to an object using `JSON.parse()` on retrieval. By setting this option to `true`,
  `Buffer` data can be stored alongside the stringified data. `Buffer`s are not
  stringified, and are copied before storage to prevent the value from changing while
  in the cache. Defaults to `false`.
- `cloneBuffersOnGet` - by default, buffers stored in the cache with `allowMixedContent`
  set to `true` are copied when they are set but not when they are retrieved. This means
  a change to the buffer returned by a `get()` will change the value in the cache. To prevent
  this, set `cloneBuffersOnGet` to  `true` to always return a copy of the cached buffer. Defaults
  to `false`.

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