1.0.1 • Published 12 years ago
account-logger v1.0.1
Account Couch Logger
Implement the account interface using a couchdb backend with the couch-profile module plus logging via a winston logger
Installation
npm install -S account-couch-logger
Usage
The account couch module exports register
and login
functions
To register a new account, pass an email
, password
and a cradle db
connection
var config = require('nconf').defaults({
couch: {
host: 'localhost',
port: 5984,
database: 'account_couch_test'
}
})
var logger = require('loggly-console-logger')
var account = require('account-couch')(logger)
var db = require('cradle-nconf')(config)
var data = {
email: 'foo@example.com',
password: 'barPassword',
db: db
}
accountCouch.register(data, function (err, reply) {
if (err) {
inspect(err, 'error registering user account')
return
}
inspect(reply, 'account created correctly'
})
Test
To run the test suite execute
# install development deps
npm install
# run tests
npm test