cerebral-pouchdb
v0.0.4
Published
A cerebral module for integrating the cerebral store with one or more pouch dbs
Downloads
1
Readme
cerebral-pouchdb
A cerebral module for integrating the cerebral store with one or more pouch dbs.
Install
npm install cerebral-pouchdb
Usage
From your main.js
// import your cerebral controller
import controller from './controller';
// import cerebral-pouchdb service
import pouchdb form 'cerebral-pouchdb';
// import your local modules
import home from './modules/home';
import notFound from './modules/notFound';
// prepare modules
const modules = {
db: pouchdb({
localDb: 'myappdb',
remoteDb: 'http://localhost:3000/db/myappdb', // optional - syncs with remote db when provided
statePath: 'data', // optional - defaults to [ 'data' ]
documentTypes: ['user', 'invoice'] // optional - defaults to all document types
}),
home,
notFound
};
// init the modules
controller.extends(modules);
Contribute
Fork repo
npm install
npm run dev
runs dev mode which watches for changes and auto lints, tests and buildsnpm test
runs the testsnpm run lint
lints the codenpm run build
compiles es6 to es5