@accumulators/core
TypeScript icon, indicating that this package has built-in type declarations

4.2.3 • Public • Published

core

Store

Store is a class that provides a simple interface for storing and retrieving key-value pairs.

Store has the following interface:

interface IStore {
  get(key: string): Promise<string | undefined>;
  getMany(keys: string[]): Promise<Map<string, string>>;

  set(key: string, value: string): Promise<void>;
  setMany(values: Map<string, string>): Promise<void>;

  delete(key: string): Promise<void>;
  deleteMany(keys: string[]): Promise<void>;
}

Implementations

Store can be implemented in many different ways, for example in memory or database.

Currently there are three implementations:

You can also implement your own store. Just write a class that implements IStore interface and you are good to go.

Readme

Keywords

none

Package Sidebar

Install

npm i @accumulators/core

Weekly Downloads

1

Version

4.2.3

License

GPL-3.0-or-later

Unpacked Size

11.5 kB

Total Files

17

Last publish

Collaborators

  • 0xmarcello
  • beeinger