# bogart-form-warden

> ## Installation

Latest version **1.2.3** (published 2017-01-03) · 0 weekly downloads

## Install

```sh
npm install bogart-form-warden
pnpm add bogart-form-warden
yarn add bogart-form-warden
bun add bogart-form-warden
```

## 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.2.3 |
| Published | 2017-01-03 |
| First published | 2013-12-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nathan Stott |
| Maintainers | nathan, soitgoes |

## Links

- npm: https://www.npmjs.com/package/bogart-form-warden
- Repository: https://github.com/nrstott/bogart-form-warden
- Homepage: https://github.com/nrstott/bogart-form-warden#readme
- Issues: https://github.com/nrstott/bogart-form-warden/issues
- npm.io page: https://npm.io/package/bogart-form-warden

## Dependencies (2)

- [bogart](https://npm.io/package/bogart.md) ~0.5.14
- [form-warden](https://npm.io/package/form-warden.md) >2.0.4

## Recent versions

- 1.2.3 (latest) — 2017-01-03
- 1.2.4 — 2014-02-04
- 1.2.2 — 2014-01-18
- 1.2.0 — 2014-01-13
- 1.1.0 — 2013-12-20
- 1.0.0 — 2013-12-20

## README

# Bogart Form Warden

## Installation

* Install with npm: `npm install bogart-form-warden`
* Clone from git: `git clone https://github.com/nrstott/bogart-form-warden`

## Usage

This package provies Form Warden JSGI middleware.
Require `bogart-form-warden` for the middleware constructor.
Use it in routes or in `app.use` calls.

Example of using `formWarden` middleware in a route:

    var router = bogart.router();

    var validationOptions = {
      fields: {
        email: [
          {
            isValid: 'required',
            message: 'Email is required'
          },
          {
            isValid: 'email',
            message: 'Email must be a valid email address'
          }
        ]
      }
    };

    router.get('/',

      formWarden(validationOptions).viewEngine(viewEngine),

      function (req) {
        var email = req.params.email;
        return viewEngine.respond('index.html', {
          locals: { email: email }
        });
      }
    );

## Tests

Run the tests with `npm test`.

## Example

* Install dependencies: `npm install`.
* Run the example in the `examples` directory: `node examples/app.js`.

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