This is no longer supported, please use https://github.com/Palmabit-IT/joi-words-extension instead.
npm install @palmabit/joi-max-words
Usage is a two steps process. First, a schema is constructed using the provided types and constraints:
const BaseJoi = require('joi');
const Extension = require('@palmabit/joi-max-words');
const Joi = BaseJoi.extend(Extension);
const schema = Joi.string().maxWords(500);