1.0.3 • Published 4 years ago

pouchdb-ex v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

PouchDB Ex

Usage

PouchDB Ex

PouchDB extension:

  • pouchdb-try: the following
    • tryGet(key, options?) - get the document of the key, return undefined instead raise error if the key is not found.
    • tryRemove(key, options?) - remove the document, return undefined instead of raise error if it doesn't exist.
    • tryPut(doc, options?) - you can use this if u need ignore the some status error, such as 409.
    • NOTE: options.ignoreStatus: do not raise error if error status is the ignoreStatus. defaults to 404.
  • pouchdb-fetch-json: only for pouchdb-adapter-http.
    • async fetchJson(path, options): the path is the relative from server url.

Installation

npm install pouchdb-ex

Then attach it to the PouchDB object:

import PouchDB from 'pouchdb';
import {installTry, installFetchJson} from 'pouchdb-ex';
PouchDB.plugin(PouchEx.installTry);
// only for adapter http:
PouchDB.plugin(PouchEx.installFetchJson);

API

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago