Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@jiango/validation

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jiango/validation

jiango validation module

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

jiango-node-validation

jiango validation module

Quick start

$ npm i @jiango/validation

app.js

'use strict';

const app = module.exports = require('jiango')();

app.setup('@jiango/validation');

app.router.post('/simple', ctx => {
  ctx.validate('simple'); // default data: ctx.request.body
  ctx.body = 'ok';
});

app.start();

validation/simple.schema.json

{
  "type": "object",
  "properties": {
    "foo": { "type": "number", "minimum": 0 },
    "bar": { "type": "string", "maxLength": 10, "minLength": 2 }
  },
  "required": ["foo", "bar"],
  "additionalProperties": false
}

Keywords

jiango

FAQs

Package last updated on 18 Jan 2021

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