3.0.0 • Published 8 years ago

joi-postcode v3.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

joi-postcode

Validate UK postcodes with Joi.

This is a regex based validation taken from the excellent postcode.js. Note that this will just check the format of the given string is correct, not that the postcode exists. See note on postcode validation.

Usage

var Joi = require('joi').extend(require('joi-postcode'))

Joi.postcode().validate('WC2N 4HG', function (err) {
  console.log(err ? 'Invalid' : 'Valid')
})