@pager/minion-joi

1.1.0 • Public • Published

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)

Package Sidebar

Install

npm i @pager/minion-joi

Weekly Downloads

17

Version

1.1.0

License

MIT

Last publish

Collaborators

  • sean-mccoy-pager
  • anthonyhancock
  • marissa-pennington-pagerhealth
  • saidavuluri
  • sharmila8908
  • udayahugar
  • vristic
  • ebrcaninovic
  • guda-onlife
  • ahmed_vuk
  • josiah-pager-2024
  • howard-at-pager
  • guessed
  • lancehamiltonolh
  • duvanmonsa
  • edzebo
  • pager-juampi
  • marcie.price
  • levi-at-pager
  • lance_lyons
  • oxymor0n
  • roybay04
  • kuryaki
  • kevinchang-pager
  • lgenzelis
  • epsanchezma
  • nupiter
  • said-pager
  • juveria.shariff
  • jsalbert3
  • ewise_onlife
  • craig-parker-pager
  • jvelezpo
  • amalajose-onlife
  • jay-darren-miller
  • meerabjorn-onlife
  • richibbs
  • moui
  • matthew_moss
  • max-d-lucas
  • justin_pennington
  • cody-greene
  • adimoff
  • felipe.correa
  • catherinekimyj-pager
  • zacharyjuang
  • 18sheimanr
  • sapnamate
  • nachocasas
  • petermai-pager
  • brianseidl_pager
  • esteban.villa
  • joe.wacker.pager
  • batroukhhamza
  • calvinkosmatka
  • i-am-ian
  • timvallier-pager
  • ankita.banait
  • alena.b.pager
  • tjharke13
  • kyleherrmann
  • durenh
  • luciabrumnich.pager
  • chrisft25
  • juandara22
  • m4shu
  • juancabuhe
  • joan.semander
  • mariano-ramonda
  • fauricio-pager
  • divyasehgal
  • mark.ferris
  • dmsq22
  • exequiel-sanoner
  • juan.lacoste.pager
  • jiggyjigsj
  • ijuani
  • jsanmi
  • aftab-alam-khan
  • peter-vizi-pager
  • ramanvas
  • circle-pager
  • sa-pagerinc-automation
  • fcue
  • shankyjs
  • ryshah1207
  • gh0stl1m-p
  • blaine-pager
  • jmelero.pager