Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pagerinc/minion-joi
Joi validation for pager/minion workers
https://github.com/pagerinc/minion-joi
Last synced: 6 days ago
JSON representation
Joi validation for pager/minion workers
- Host: GitHub
- URL: https://github.com/pagerinc/minion-joi
- Owner: pagerinc
- License: mit
- Created: 2017-08-25T20:04:34.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T20:03:07.000Z (about 6 years ago)
- Last Synced: 2024-03-14T22:11:55.057Z (8 months ago)
- Language: JavaScript
- Size: 34.2 KB
- Stars: 0
- Watchers: 33
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**Minion-joi** — _Joi validation for pager/minion workers_
## Usage Example
```javascript
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:
```javascript
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)
```