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

@pager/minion-joi

Package Overview
Dependencies
Maintainers
14
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pager/minion-joi

Joi validation for pager/minion workers

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
28
-31.71%
Maintainers
14
Weekly downloads
 
Created
Source

Minion-joiJoi validation for pager/minion workers

Usage Example

const validation = require('minion-joi')

const validator = validation(Joi.object({
    foo: Joi.string().required()
}))

const handler = (message) => {
   return `Hello ${message.foo}`
}

module.exports = validator(handler)

By default minion will nack and not requeue messages on failure, if you want the message to be requeued after failing validation you can do it like this:

const validation = require('minion-joi')

const validator = validation(Joi.object({
    foo: Joi.string().required()
}), { requeue: false })

const handler = (message) => {
   return `Hello ${message.foo}`
}

module.exports = validator(handler)

Keywords

microservices

FAQs

Package last updated on 15 Jan 2018

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