# @exact-realty/memcached-encrypted-store

> A secure and efficient encrypted store of keys and values for memcached

Latest version **1.0.1** (published 2023-10-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install @exact-realty/memcached-encrypted-store
pnpm add @exact-realty/memcached-encrypted-store
yarn add @exact-realty/memcached-encrypted-store
bun add @exact-realty/memcached-encrypted-store
```

## Health

**Score 35/100 (D)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-10-06 |
| First published | 2023-05-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (Unknown) |
| GitHub stars | 0 |
| Author | Exact Realty Limited |
| Maintainers | er-ci-bot, corrideat |
| Keywords | memcached, encrypted, store, caching, security, data integrity, symmetrical encryption |

## Links

- npm: https://www.npmjs.com/package/@exact-realty/memcached-encrypted-store
- Repository: https://github.com/Exact-Realty/ts-memcached-encrypted-store
- Homepage: https://github.com/Exact-Realty/ts-memcached-encrypted-store#readme
- Issues: https://github.com/Exact-Realty/ts-memcached-encrypted-store/issues
- npm.io page: https://npm.io/package/@exact-realty/memcached-encrypted-store

## 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.1 (latest) — 2023-10-06
- 1.0.0 — 2023-05-22

## README

# memcached-encrypted-store 🗄️

[![License](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)

> A secure and efficient encrypted store of keys and values for memcached.

Welcome to `memcached-encrypted-store`! This NPM package provides a convenient
solution for storing encrypted data in memcached, ensuring the confidentiality
and integrity of your cached information. With `memcached-encrypted-store`, you
can protect your sensitive data while benefiting from the speed and scalability
of memcached.

## ✨ Features

* ✅ Securely store and retrieve keys and values in memcached
* ✅ Encryption of data with non-persistent symmetrical keys
* ✅ Data integrity verification to prevent tampering
* ✅ Configurable cache settings for optimal performance
* ✅ Simple and intuitive usage

## 🚀 Installation

To start using `memcached-encrypted-store` in your project, simply install it
via npm:

```sh
npm install @exact-realty/memcached-encrypted-store
```

## 📝 Usage

To use `memcached-encrypted-store`, follow these steps:

1. Import the necessary modules:
```js
import m from '@exact-realty/memcached-encrypted-store';
import Memcached from 'memcached';
```

2. Initialize the encrypted memcached instance by providing the required configurations:
```js
const encryptedMemcached = await m({
  cacheMinAge: 1,
  cacheMaxAge: 60,
  cacheDefaultAge: 30,
  cacheClockDriftAdjustment: 1,
  memcached: new Memcached('memcached-server');
});
```

3. Store a value in memcached:
```js
const optionalTtl = 5;
await c('some-key', new Uint8Array([1,2,3]), optionalTtl);
// or altenatively (using the default TTL)
await c('some-key', new Uint8Array([1,2,3]));
// or (using object notation)
// note that fetching immediately after will likely fail, as this is
// an asynchronous operation
c['some-key'] = new Uint8Array([1,2,3]);
```

4. Retrieve a value from memcached:
```javascript
// Warning: may throw
console.log(await c['some-key']);
```

5. Delete a value from memcached:
```javascript
delete c['some-key'];
```

## 🤝 Contributing

🎉 We appreciate contributions from the community! If you have any ideas or
suggestions, feel free to open an issue or submit a pull request.

## 📃 License

This project is licensed under the ISC License. See the [LICENSE](LICENSE) file
for details.

---
_Source: https://npm.io/package/@exact-realty/memcached-encrypted-store · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
