How to use pouchdb-node - 3 common examples

To help you get started, we’ve selected a few pouchdb-node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ewnd9 / media-center / test / fixtures / create-db.js View on Github external
import initDb from '../../src/models/index';
import PouchDB from 'pouchdb-node';
PouchDB.plugin(require('pouchdb-adapter-memory'));

export const generateTmpDir = () => '/tmp/media-center-db-' + Math.random();
export default () => initDb(generateTmpDir(), { adapter: 'memory' });
github ewnd9 / media-center / src / models / index.js View on Github external
.reduce((result, key) => {
      const name = key.toLowerCase();

      const db = new PouchDB(`${dbPath}-${name}`, dbOptions);
      db.on('error', err => console.log('pouch-error', err));

      const obj = initializers[key];
      const validate = validateFactory(obj.schema);

      result[key] = new Model(db, obj, validate);

      return result;
    }, {});
github ewnd9 / media-center / src / models / index.js View on Github external
import PouchDB from 'pouchdb-node';
import t from 'tcomb-validation';
import Model from 'pouchdb-model';

import MigratePlugin from 'pouchdb-migrate';

PouchDB.plugin(MigratePlugin);

import File from './file';
import Prefix from './prefix';

import EpisodeScrobble from './episode-scrobble';
import MovieScrobble from './movie-scrobble';

import Show from './show';
import Movie from './movie';
import Person from './person';

export default (dbPath, dbOptions = {}) => {
  const initializers = {
    File,
    Prefix,
    EpisodeScrobble,

pouchdb-node

PouchDB, the Node-only edition.

Apache-2.0
Latest version published 6 months ago

Package Health Score

80 / 100
Full package analysis

Popular pouchdb-node functions

Similar packages