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

koa-inquirer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-inquirer

## Installation ```bash npm install --save koa-inquirer ```

  • 1.0.5
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

koa-inquirer

Installation

npm install --save koa-inquirer

Usage

This package uses Joi to validate the data, so you need to install it.

server.js

const Koa = require('koa')
const inquirer = require('koa-inquirer')

const server = new Koa()

server.use(inquirer())

server.listen(3000)

controllers/example.js

const Joi = require('@hapi/joi')

module.exports = ({ request }) => {
  const schema = Joi.object({
    name: Joi.string().required()
  })
  const validated = request.validate(schema) // it will validate request.body, but you can pass other one. ex: validate(schema, request.params)
  ...
}

Author

Gideão Silva

FAQs

Package last updated on 28 Jul 2020

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