joi-imo-number-extension
v1.1.0
Published
A Joi extension for validation of vessel IMO numbers
Downloads
8
Readme
Joi IMO Number Extension
A Joi extension for validationg vessel IMO numbers.
Installation
npm install --save joi-imo-number-extension
Usage
const BaseJoi = require('joi')
const JoiIMONumberExtension = require('joi-imo-number-extension')
const Joi = BaseJoi.extend(JoiIMONumberExtension)
const schema = Joi.string().imoNumber()
const result = await schema.validate('IMO 7035341')
console.log(result) // IMO 7035341