JSPM

postal-codes

1.0.852
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 339
  • Score
    100M100P100Q121126F
  • License Apache-2.0

Maps postal codes to polygons

Package Exports

  • postal-codes

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

Readme

postal-codes

NPM version Downloads

Maps postal codes to polygons.

Usage

Install the library with npm install postal-codes

var PostalCodes = require('postal-codes');

var postalCodes = new PostalCodes();

// Get supported countries
postalCodes.supportedCountries().then(function(value) {
  value.countryCodes; //->  Array of ISO 3166-1 alpha-2 country codes
});

// Get some postal code
postalCodes.area({
  countryCode: "US",
  postalCode: "90210"
}).then(function(value) {
  value.countryCode; //-> "US"
  value.id;          //-> "90210"
  value.polygons;    //-> Array of polygons that represent this postal code
});

Reporting Issues

Please use the issue tracker to report issues related to this library.

License

This library uses the Apache License, version 2.0.