joi-country-extension

1.2.0 • Public • Published

Joi Country Extension

A Joi extension for validation of ISO 3166-1 alpha-2 country codes.

Installation

npm install --save joi-country-extension

Usage

const BaseJoi = require('joi')
const JoiCountryExtension = require('joi-country-extension')
const Joi = BaseJoi.extend(JoiCountryExtension)
 
const schema = Joi.string().country()
const result = await schema.validate('gb')
 
console.log(result) // GB

Readme

Keywords

none

Package Sidebar

Install

npm i joi-country-extension

Weekly Downloads

521

Version

1.2.0

License

MIT

Unpacked Size

3.4 kB

Total Files

4

Last publish

Collaborators

  • ruchevits