1.4.0 • Published 2 years ago

@becomes/purple-cheetah-mod-fsdb v1.4.0

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

Purple Cheetah Module - FSDB

Logo

Install npm i --save @becomes/purple-cheetah-mod-fsdb

It is a small, nice module for local development. It provides the same API as MongoDB module which makes it quite easy to migrate between them.

IMPORTANT: This package is not design to be used as production database. It is save to use for very small databases in production and for some light caching but cannot replace the MongoDB, MySQL or any other real database. This is due to package design which will be explained in the document.

Core concepts

Since this package emulates the MongoDB, core concepts are pretty similar. Data is stored in collections and each collection holds entities/documents. Each collection is represented with a Repository which provides some basic methods for querying and mutating collection items. Data is stored in the database as shown below:

Repository 1
  ---> Entity 1
  ---> Entity 2
  ---> .....
Repository 2
  ---> Entity 1
  ---> Entity 2
  ---> .....
Repository 3
  ---> Entity 1
  ---> Entity 2
  ---> .....
.....

Once FSDB module is mounted in a Purple Cheetah application, first, it will search for database file at specified path (default path is $CWD/db/.fsbd.json). If file exists, it will load it and save it in-memory. This is the only time in lifecycle of the app that database file is read.

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago