Socket
Socket
Sign inDemoInstall

@pager/minion-joi

Package Overview
Dependencies
1
Maintainers
14
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pager/minion-joi


Version published
Maintainers
14
Install size
355 kB
Created

Readme

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

FAQs

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc