JSON Document store with flexible backend (files on fs, PouchDB, etc)
TBD
TBD
Requires Node.js 8.10+.
npm install flex-docstore
const { FlexDocStore } = require('flex-docstore')
const store = FlexDocStore.using('files', { dir: './db' })
const store = FlexDocStore.using('mock')
The storage API is based on the PouchDB API
post
is not implemented (use uuid +put
)
async get (key)
Retrieves the document at a given key (null if not found).
const data = await store.get('key1')
async put (key, value)
Writes a document to a given key.
await store.put('key1', doc)
async remove (key)
Deletes a document.
await store.remove('key1')
async allDocs ()
Lists all documents in the store.
await store.allDocs({ include_docs: false })
PRs accepted.
Code style: Standard JS
Comments style: JSDoc.
README style: If editing the Readme, please conform to the standard-readme specification.
MIT LICENSE © Interop Alliance, Dmitri Zagidulin