0.0.4 • Published 10 years ago
cerebral-pouchdb v0.0.4
cerebral-pouchdb
A cerebral module for integrating the cerebral store with one or more pouch dbs.
Install
npm install cerebral-pouchdbUsage
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 installnpm run devruns dev mode which watches for changes and auto lints, tests and buildsnpm testruns the testsnpm run lintlints the codenpm run buildcompiles es6 to es5