JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 75
  • Score
    100M100P100Q70237F
  • License MIT

Joi extension to validate USA zip codes

Package Exports

  • joi-us-zipcode
  • joi-us-zipcode/build/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (joi-us-zipcode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

joi-us-zipcode

MIT License Build Status

NPM status

Joi extension to validate USA zip codes.

The list of codes is copied from the source of https://github.com/davglass/zipcodes.

const BaseJoi = require('joi');
const Extension = require('joi-us-zipcode');
const Joi = BaseJoi.extend(Extension);

const schema = {
  zip: Joi.string().usZipCode(),
};
const object = {
  zip: '75001',
};

Joi.validate(schema, object);