- Get index.js and test.js in the same (otherwise empty) directory.
- Execute the following commands:
npm install pouchdb memdown pouchdb-abstract-mapreduce evaljs
node test.js
marten@marten-laptop:~/git/mapreduce$ npm run test --coverage | |
> [email protected] test /home/marten/git/mapreduce | |
> npm run jshint && ./bin/run-test.sh | |
> [email protected] jshint /home/marten/git/mapreduce | |
> jshint -c .jshintrc *.js test/test.js | |
msgid "" | |
msgstr "" | |
msgid "Most of the PouchDB API is exposed as `fun(arg, [options], [callback])` where both the options and the callback are optional. Callbacks use the `function(err, result)` idiom where the first argument will be undefined unless there is an error, and the second argument holds the result." | |
msgstr "" |
marten@procyon:~/Bureaublad$ mkdir temp | |
marten@procyon:~/Bureaublad$ cd temp/ | |
marten@procyon:~/Bureaublad/temp$ npm cache clean | |
marten@procyon:~/Bureaublad/temp$ git clone --depth=30 git://github.com/pouchdb/express-pouchdb.git pouchdb/express-pouchdb | |
marten@procyon:~/Bureaublad/temp$ cd pouchdb/express-pouchdb | |
marten@procyon:~/Bureaublad/temp/pouchdb/express-pouchdb$ git fetch origin +refs/pull/170/merge: | |
marten@procyon:~/Bureaublad/temp/pouchdb/express-pouchdb$ git checkout -qf FETCH_HEAD | |
marten@procyon:~/Bureaublad/temp/pouchdb/express-pouchdb$ export CLIENT=node | |
marten@procyon:~/Bureaublad/temp/pouchdb/express-pouchdb$ export COMMAND=test-pouchdb-minimum | |
marten@procyon:~/Bureaublad/temp/pouchdb/express-pouchdb$ npm install |
//PouchDB.destroy() is (going to be) deprecated by PouchDB, but the | |
//semantics from db.destroy() differ when wrapped so re-add it. | |
if (!(PouchDB.destroy || {}).isResurrected) { | |
var orig = PouchDB.destroy; | |
PouchDB.destroy = function (name, options, callback) { | |
var args = parseBaseArgs(PouchDB, this, options, callback); | |
//3.2.2 deprecates .destroy() and introduces opts.internal for as | |
//long as PouchDB will still use the method internally (hopefully) | |
if (!(PouchDB.version >= '3.2.2') || args.options.internal) { |
A description of how to run an existing CouchApp on PouchDB in the browser using service workers - without any modifications to existing code being necessary! The best thing is that if service workers aren't available, the CouchApp will still run as normal: that is, online.
var wrappers = require("pouchdb-wrappers"); | |
var noops = {}; | |
// also add all the other methods | |
"get allDocs getAttachment info revsDiff put post".split(" ")).forEach(function (name) { | |
noops[name] = function (orig) {return orig(); }; | |
}); | |
wrappers.installWrapperMethods(db, noops); |