Skip to content

Memory Card is an Easy to Use Key/Value Store Implements ES6 Map with Async API in Distribution Scenarios.

License

Notifications You must be signed in to change notification settings

iguxiaobei/memory-card

 
 

Repository files navigation

MEMORY CARD

NPM Version npm (next) Powered by TypeScript Build Status

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

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

Memory Card

API

/**
 * ES6 Map like Async API
 */
export interface AsyncMap<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 AsyncMap { ... }

1. load()

2. save()

3. destroy()

4. multiplex()

TODO

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

CHANGELOG

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
  2. NPM Pack Testing
  3. 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
  2. Update the API to ES6 Map-like, the difference is that MemoryCard is all Async.

AUTHOR

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

profile for zixia at Stack Overflow, Q&A for professional and enthusiast programmers

COPYRIGHT & LICENSE

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

About

Memory Card is an Easy to Use Key/Value Store Implements ES6 Map with Async API in Distribution Scenarios.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.5%
  • Shell 2.3%
  • JavaScript 0.2%