PouchDB is an in-browser database that allows applications to save data locally, so that users can enjoy all the features of an app even when they're offline. Plus, the data is synchronized between clients, so users can stay up-to-date wherever they go.
PouchDB also runs in Node.js and can be used as a direct interface to CouchDB-compatible servers. The API works the same in every environment, so you can spend less time worrying about browser differences, and more time writing clean, consistent code.
To start using PouchDB in your website, simply download it and include it in your page:
Or install it with Bower:
$ bower install --save pouchdb
Or install it as a Node.js module:
$ npm install --save pouchdb
In the browser, getting started is as simple as:
var db = new PouchDB('my_database');
In Node.js, you'll need to
require() it first:
var PouchDB = require('pouchdb'); var db = new PouchDB('my_database');
Or, to use PouchDB as a direct client to CouchDB, simply pass in a URL:
var db = new PouchDB('http://localhost:5984/my_database');
All of these
dbs share the same API, regardless of where they're storing data!
- Firefox 29+
- Chrome 30+
- Safari 5+
- Internet Explorer 10+
- Opera 21+
- Android 4.0+
- iOS 7.1+
- Windows Phone 8+
PouchDB also runs in Cordova/PhoneGap, NW.js, Atom Shell, and Chrome apps. It is framework-agnostic, and you can use it with Angular, React, Ember, Backbone, or your framework of choice. There are many adapters, or you can just use PouchDB as-is.
PouchDB requires a modern ES5 environment, so if you need to support older browsers (IE <10, Android <4.0, Opera Mini), then you should include the es5-shim library. You can also use the LocalStorage and in-memory adapters, or fall back to a live CouchDB.
PouchDB can also run as its own CouchDB-compatible web server, using PouchDB Server.
Latest and greatest:
For past releases and changelog, check out the Github releases page.
For plugins, see the plugins page.