Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bogart-form-warden

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bogart-form-warden

## Installation

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
2
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 03 Jan 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc