(#2286) - browserifiable adapter plugins This finishes up the work @calvinmetcalf and I started on this some time ago. Now, you can either use the LocalStorage/memory/idb-alt plugins as standalone scripts downloaded from the website, or via the "extras" API, allowing them to be Browserified/Webpacked. I tested this out and confirmed that, when `require()`d from a separate project, Browserify does an intelligent job deduplicating the code. E.g. PouchDB itself is only included once. For instance, when using Browserify, PouchDB and the memory adapter will add up to 710K. When using separate standalone scripts, you're looking at 352K for PouchDB and 470K for the memory plugin script, which adds up to 822K. So you save nearly 100K, which ain't bad. This commit should also make it easier to create new browser adapter plugins in the future. The API is much simplified and requires a lot less command-line Browserify magic. Note that the "browserify API" itself is not tested in CI; we're still testing the standalone scripts the old-fashioned way. But since the standalone scripts are just browserified versions of the "extras" APIs (with `-x pouchdb` thrown in to avoid browserifying PouchDB itself), I think this is pretty low-risk.
PouchDB was written to help web developers build applications that work as well offline as well as they do online, applications save data locally so the user can use all the features of an app even while offline and synchronise the data between clients so they have up to date data wherever they go.
PouchDB is a free open source project, written in Javascript by these wonderful contributors and inspired by Apache CouchDB.
To get started using PouchDB check out our Documentation and the API Documentation.
If you want to get involved then check out the contributing guide
var db = new PouchDB('dbname'); db.put({ _id: 'dave@gmail.com', name: 'David', age: 68 }); db.changes().on('change', function() { console.log('Ch-Ch-Changes'); }); db.replicate.to('http://example.com/mydb');