@pixul/joi-country

1.0.0 • Public • Published

Joi Country

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

Installation

npm install --save @pixul/joi-country

Usage

const BaseJoi = require('@hapi/joi')
const JoiCountryExtension = require('@pixul/joi-country')
const Joi = BaseJoi.extend(JoiCountryExtension)

const schema = Joi.string().country()
const result = await schema.validate('gb')

console.log(result) // GB

Credits

This plugin is a fork & rewrite of https://github.com/Tallysticks/joi-country-extension to support joi > 16

Readme

Keywords

Package Sidebar

Install

npm i @pixul/joi-country

Weekly Downloads

2,954

Version

1.0.0

License

MIT

Unpacked Size

4.73 kB

Total Files

6

Last publish

Collaborators

  • anais-jarno.pixul
  • gaetan_cany
  • damvar
  • dianelam
  • romainpixul
  • karimgasmi47
  • p-sam
  • pixulslave
  • yoannma
  • estebanl