You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

caffe-validate

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caffe-validate

The official validation library for Caffe.

1.0.0-alpha
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Caffe Validation

The official validation library for building opinionated, Caffe applications. This library is built on top of the joi. It offers validation support for both query string parameters and the request body (input). This library does not yet offer support for file-based validation.

Getting Started

Install via npm:

npm install --save caffe-validate

Example Usage

Create a NodeJS server using the contents below, then launch the application and go to https://localhost:5000 in your browser. Feel free to add the name key as a query string value to print your name instead of the default "World".

Example: https://localhost:5000?name=JohnSmith

var caffe     = require("caffe");
var validate  = require("caffe-validate");

var app = caffe.brew([
  validate.query(is => {
    name: is.string().default("World"),
  }),
  caffe.text(200, (ctx) => `Hello, ${ctx.query.name}`),
]);

caffe.serve(app, 5000);

Documentation

Coming soon.

Keywords

validate

FAQs

Package last updated on 27 Sep 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