pouchdb-users
PouchDB plugin to simulate CouchDB’s _users database behavior
pouchdb-users
hashes passwords and ensures doc formats as CouchDB does it with
its _users
database, so that any database and leveldown adapter can be used
besides CouchDB for persisting user accounts.
Example
var PouchDB = PouchDB var db = 'my-users' db: db
The above example works the same against a couchdb
var db = 'http://localhost:5984/_users' auth: username: 'admin' password: 'secret' db
How it works
pouchdb-users
does not add any additional methods to db
, but hooks into
db.put
, db.post
and db.bulkDocs
to modify the document before storing it
in the database.
Note that pouchdb-users
does not implement any access restrictions, there
is no user context available in PouchDB.
Testing
Local setup
git clone git@github.com:hoodiehq/pouchdb-users.git
cd pouchdb-users
npm install
Run all tests and code style checks
npm test
Run specific tests only
node tests/specs/debug.js # run .debug() unit tests
PROTIP™: pipe output through a pretty reporter