Socket
Book a DemoInstallSign in
Socket

account-logger

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

account-logger

Add logging to the account interface

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
7
600%
Maintainers
1
Weekly downloads
 
Created
Source

Account Couch Logger

Log register and login requests to an account module

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')
// instatiate an couchdb-based account backend object
var AccountCouch = require('account-couch')
var db = require('cradle-nconf')(config)
var data = {
  email: 'foo@example.com',
  password: 'barPassword',
  db: db
}

var accountCouch = new AccountCouch(db)
var AccountLogger = require('account-logger')

// instatitate the account logger object, passing  the couchdb-based account backend and the winston logger object as paramteres to the constructor
var account = new AccountLogger(accountCouch, logger)

account.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

Keywords

account

FAQs

Package last updated on 01 May 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.