0.0.6 • Published 5 years ago

docs-db v0.0.6

Weekly downloads
9
License
AGPL-3.0
Repository
github
Last release
5 years ago

docs-db

Build Status Coverage Status

Simple docs database with history support.

Install

$ npm install docs-db

Usage

const DocsDb = require("docs-db")

const db = new DocsDb()

API

DocsDb(data)

data

Type: object with db and history keys

const DocsDb = require("docs-db")

const db = new DocsDb()

db.export

Export the whole content with history in an object with db and history keys. You can pass the result to the constructor to initialize it with content.

db.historyCount

db.docCount

db.docIds

db.docMetas

db.sizeCurrent

db.sizeHistory

db.size

db.getDoc(_id, _rev)

db.deleteDoc(_id, currentRev)

db.revertDoc(_id, currentRev, to)

db.updateDoc(newDoc, currentRev)

License

AGPL-v3 © 2018 Robin Millette