New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

joi-router

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi-router

Input & Output validated routing for Express

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

joi-router

:basketball: Input & Output validated routing for Express

Build Status Coverage Status

Todo List

  • :white_check_mark: Input Validated Routing
  • :white_check_mark: Output Validated Routing
  • :white_check_mark: Examples to show how to use joi-router
  • :white_check_mark: Self-contained Test
  • :white_check_mark: Continuous integration
  • :white_check_mark: Code coverage
  • :ballot_box_with_check: Joi-router to documents

How to install

yarn add joi-router

Get Started

Input Validaiton

const express = require('express')
const Joi = require('joi')
require('joi-router')
const app = express()

app.get('/foo', {query: {
  userId: Joi.string().alphanum().min(3).max(30).required()
}}, function (req, res, next) {
  res.json({
    result: 'success'
  })
})
Output Validation
app.get('/foo', {
  output: {
    '200': { content: Joi.string().alphanum().min(3).max(30).required() }
  }
}, function (req, res, next) {
  res.json({
    content: 'Lorem'
  })
})

app.listen(3000, () => {
  console.log('Server Run!')
})

Node compatibility

NodeJS >= 6.0 is required.

Performance

Joi-router only run once to add validation middleware when express start, so it does not make express slow.

LICENSE

License: MIT

Keywords

FAQs

Package last updated on 10 May 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