JSPM

zipcode-patterns

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

A list of regular expressions for zip codes

Package Exports

  • zipcode-patterns

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 (zipcode-patterns) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

zipcode-patterns

A list of regular expressions for zip codes

Install

$ npm install --save zipcode-patterns

Usage

via require:

const zipcodes = require('zipcode-patterns');

console.log(zipcodes)
// => "AC": "^(ASCN 1ZZ)$", "AD": "^(?:AD)*(\\d{3})$", etc

const deZipPattern = new RegExp(zipCodes['DE']);
const isValid = deZipPattern.test('89081');

via import:

import * as zipCodes from 'zipcode-patterns/zipcode-patterns.json';

const deZipPattern = new RegExp(zipCodes['DE']);
const isValid = deZipPattern.test('89081');

License

MIT © Henrique Dias