1.0.1 • Published 11 years ago

account-logger v1.0.1

Weekly downloads
6
License
-
Repository
github
Last release
11 years ago

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
1.0.1

11 years ago

1.0.0

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago