JSPM

koa-parameter

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 207
  • Score
    100M100P100Q80898F
  • License MIT

parameter validate middleware for koa

Package Exports

  • koa-parameter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (koa-parameter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

koa-parameter

NPM version build status Test coverage David deps node version Gittip

parameter validate middleware for koa, powered by parameter.

Installation

$ npm install koa-parameter --save

Usage

var koa = require('koa');
var parameter = require('koa-parameter');

parameter(app); // add verifyParams method, but don't add middleware to catch the error
// app.use(parameter(app)); // also add a middleware to catch the error.

app.use(function* () {
  this.verifyParams({
    name: 'string'
  });
});

Checkout parameter to get all the rules.

Example

License

MIT