New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pixul/joi-country

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixul/joi-country

ISO Country extension for Joi

1.0.0
latest
Source
npm
Version published
Weekly downloads
3K
35.54%
Maintainers
3
Weekly downloads
 
Created
Source

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

Keywords

joi

FAQs

Package last updated on 29 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts