# account-logger

> Add logging to the account interface

Latest version **1.0.1** (published 2013-05-01) · BSD license · 0 weekly downloads

## Install

```sh
npm install account-logger
pnpm add account-logger
yarn add account-logger
bun add account-logger
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2013-05-01 |
| First published | 2013-04-30 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Noah Isaacson |
| Maintainers | clewfirst |
| Keywords | account |

## Links

- npm: https://www.npmjs.com/package/account-logger
- Repository: https://github.com/nisaacson/account-logger
- npm.io page: https://npm.io/package/account-logger

## Dependencies (3)

- [cloneextend](https://npm.io/package/cloneextend.md) 0.0.3
- [simple-mixin](https://npm.io/package/simple-mixin.md) ~1.0.0
- [account-couch](https://npm.io/package/account-couch.md) ~1.0.1

## Recent versions

- 1.0.1 (latest) — 2013-05-01
- 1.0.0 — 2013-05-01
- 0.0.5 — 2013-05-01
- 0.0.4 — 2013-04-30
- 0.0.3 — 2013-04-30
- 0.0.2 — 2013-04-30
- 0.0.1 — 2013-04-30

## README

# Account Couch Logger
Log register and login requests to an account module 

# Installation

```bash
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
```javascript

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

```bash
# install development deps
npm install
# run tests
npm test
```

---
_Source: https://npm.io/package/account-logger · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
