reposy

1.0.1 • Public • Published

Repository

Repository

Usage

  1. Prepare;
  2. Commands.

Prepare

  1. (Optional) Import types;
  2. Prepare context;
  3. Create repository.

Import types

/**
 * @typedef {import('repository').Context} Context
 */

Prepare context

/** @type {Context} */
const context = {};

Create repository

return new Repository({
  context,
  modelFactory
});

Commands

  1. Get;
  2. Set;
  3. Get all;
  4. Has;
  5. Remove;
  6. Clear.

Get

const data = await repository.set('key');

Set

await repository.set('key', 'data');

Get all

const data = await repository.getAll();

Has

const has = await repository.has(1);

Remove

await repository.remove(1);

Clear

await repository.clear();

Readme

Keywords

Package Sidebar

Install

npm i reposy

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

9.36 kB

Total Files

7

Last publish

Collaborators

  • ilushling