# memory-card

> ES6 Map like Async API, with Swagger API Backend Support.

Latest version **1.0.3** (published 2021-11-10) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-11-10 |
| First published | 2018-05-31 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=16 |
| Dependencies | 2 |
| Unpacked size | 297.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Huan LI |
| Maintainers | zixia |
| Keywords | async, map, swagger, openapi, key, value, store |

## Links

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

## Dependencies (2)

- [brolog](https://npm.io/package/brolog.md) ^1.12.4
- [async-map-like](https://npm.io/package/async-map-like.md) ^0.2.5

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2021-11-10
- 1.1.2 (next) — 2021-11-27
- 1.0.2 — 2021-11-10
- 0.13.5 — 2021-08-02
- 0.13.4 — 2021-08-01
- 0.12.2 — 2021-03-12
- 0.10.1 — 2020-07-30
- 0.9.5 — 2020-07-30
- 0.9.4 — 2020-07-30
- 0.9.3 — 2020-07-30
- 0.9.2 — 2020-07-30
- 0.9.1 — 2020-07-30
- 0.7.1 — 2020-06-08
- 0.7.0 — 2020-04-30
- 0.6.21 — 2019-09-11
- … 31 more at https://npm.io/package/memory-card/versions

## README

# MEMORY CARD

[![NPM Version](https://img.shields.io/npm/v/memory-card?color=brightgreen)](https://www.npmjs.com/package/memory-card)
[![npm (next)](https://img.shields.io/npm/v/memory-card/next.svg)](https://www.npmjs.com/package/memory-card?activeTab=versions)
[![GitHub Action](https://github.com/huan/memory-card/workflows/NPM/badge.svg)](https://github.com/huan/memory-card/actions?query=workflow%3ANPM)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)

Memory Card is an Easy to Use Key/Value Store, with Swagger API Backend &amp; Serialization Support.

- It is design for using in distribution scenarios.
- It is NOT design for performance.

![Memory Card](https://huan.github.io/memory-card/images/memory-card-logo.png)

## API

```ts
/**
 * ES6 Map like Async API
 */
export interface AsyncMapLike<K = any, V = any> {
  size: Promise<number>

  [Symbol.asyncIterator](): AsyncIterableIterator<[K, V]>
  entries()                  : AsyncIterableIterator<[K, V]>
  keys    ()                 : AsyncIterableIterator<K>
  values  ()                 : AsyncIterableIterator<V>

  get     (key: K)           : Promise<V | undefined>
  set     (key: K, value: V) : Promise<void>
  has     (key: K)           : Promise<boolean>
  delete  (key: K)           : Promise<void>
  clear   ()                 : Promise<void>
}

export class MemoryCard implements AsyncMapLike { ... }
```

> `MemoryCard` is an [AsyncMapLike](https://github.com/huan/async-map-like) interface

### 1. load()

### 2. save()

### 3. destroy()

### 4. multiplex()

## TODO

1. Swagger API Backend Support
1. toJSON Serializable with Metadata

## CHANGELOG

### master v1.0 (Nov 10, 2021)

1. Release v1.0
1. ES Module support

### v0.13 (Aug, 2021)

1. Move S3 & OBS to peer dependency to reduce install size
1. Add Etcd Storage support

### v0.6 master (Aug 2018)

1. Support AWS S3 Cloud Storage

### v0.4 July 2018

1. Add `multiplex()` method to Multiplex MemoryStore to sub-MemoryStores.

### v0.2 June 2018

1. Unit Testing
1. NPM Pack Testing
1. DevOps to NPM with `@next` tag support for developing branch

### v0.0 May 31st, 2018

1. Promote `Profile` of Wechaty to SOLO NPM Module: `MemoryCard`
1. Update the API to ES6 `Map`-like, the difference is that MemoryCard is all **Async**.

## AUTHOR

[Huan LI](http://linkedin.com/in/zixia) \<zixia@zixia.net\>

<a href="http://stackoverflow.com/users/1123955/zixia">
  <img src="http://stackoverflow.com/users/flair/1123955.png" width="208" height="58" alt="profile for zixia at Stack Overflow, Q&amp;A for professional and enthusiast programmers" title="profile for zixia at Stack Overflow, Q&amp;A for professional and enthusiast programmers">
</a>

## COPYRIGHT & LICENSE

- Code & Docs © 2017-now Huan LI \<zixia@zixia.net\>
- Code released under the Apache-2.0 License
- Docs released under Creative Commons

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