joi-imo-number-extension

A Joi extension for validation of vessel IMO numbers

Usage no npm install needed!

<script type="module">
  import joiImoNumberExtension from 'https://cdn.skypack.dev/joi-imo-number-extension';
</script>

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