zipToTz
This package provides an updated list of US zipcodes from trusted source (2020).
Installation
npm install --save zipcode-to-timezone
Import
const { ZipToTz } = require('zip-to-timezone');
import { ZipToTz } from 'zip-to-timezone';
Usage
try {
const tz = new ZipToTz().full('33487');
const tz = new ZipToTz().short('33487');
} catch(error) {
}
Error Messages
If the input is non-number as string or the length is not 5
If the provided zip does not have any mapping.
build and test
npm install && npm test
publish
npm run publish
Note: Do not forget to update the version using npm version
command!