14.0.0 • Published 3 years ago

sengi-docstore-mem v14.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Sengi DocStore Mem

This package is part of the Sengi family.

npm.io npm

An in-memory implementation of the Sengi document store interface.

Installation

npm install sengi-docstore-mem

Usage

The MemDocStore implements the DocStore interface defined in sengi-interfaces.

To instantiate a MemDocStore you have to provide the following parameters:

  • docs - An array of Doc objects.

  • generateDocVersionFunc - A function () => string that returns a string of random characters.

const memDocStore = new MemDocStore({
    docs: [],
    generateDocVersionFunc: () => crypto.randomBytes(Math.ceil(10)).toString('hex').slice(0, 20)
  })

This example uses the standard NodeJs crypto library to produce a string of 20 random hex characters for generateDocVersionFunc.

Limitations

This provider will not persist any changes because all the operations occur on a Doc's array in-memory.

This provider does not support indexes and cannot be scaled to multiple nodes.

It is great for testing purposes but probably not useful in production.

Development

Tests are written using Jest with 100% coverage.

npm test

Continuous Deployment

Any pushes or pull-requests on non-master branches will trigger the test runner.

Any pushes to master will cause the family of libraries to be re-published.

14.0.0

3 years ago

13.3.1

3 years ago

13.3.0

3 years ago

13.2.0

3 years ago

13.2.1

3 years ago

13.1.0

3 years ago

13.0.1

3 years ago

13.0.0

3 years ago

12.0.0

3 years ago

11.2.0

3 years ago

11.2.1

3 years ago

11.1.1

3 years ago

11.0.0

3 years ago

11.1.0

3 years ago

10.0.0

3 years ago

9.1.0

3 years ago

9.0.0

3 years ago

8.5.0

3 years ago

8.4.4

3 years ago

8.4.3

3 years ago

8.4.2

3 years ago

8.4.1

3 years ago

8.4.0

3 years ago

8.3.0

3 years ago

8.2.0

3 years ago

8.1.1

3 years ago

8.1.0

3 years ago

8.0.0

3 years ago

7.7.3

3 years ago

7.7.2

3 years ago

7.7.1

3 years ago

7.7.0

3 years ago

7.6.1

3 years ago

7.6.0

3 years ago

7.5.0

3 years ago

7.4.0

3 years ago

7.3.2

3 years ago

7.3.1

3 years ago

7.3.0

3 years ago

7.2.1

3 years ago

7.2.0

3 years ago

7.1.0

3 years ago

7.0.0

3 years ago

6.7.0

3 years ago

6.6.0

3 years ago

6.5.0

3 years ago

6.4.1

3 years ago

6.3.3

3 years ago

6.3.2

3 years ago

6.3.1

3 years ago

6.3.0

3 years ago

6.2.0

3 years ago