This package provides an updated list of US zipcodes from trusted source (2020).
npm install zip-to-timezoneThis package provides an updated list of US zipcodes from trusted source (2020).
``bash`
npm install --save zip-to-timezone
`javascript`
const { ZipToTz } = require('zip-to-timezone');
// OR
import { ZipToTz } from 'zip-to-timezone';
`javascript`
try {
const tz = new ZipToTz().full('33487'); // America/New_York
const tz = new ZipToTz().short('33487'); // EDT
} catch(error) {
// handler error
}
- Incorrect input
If the input is non-number as string or the length is not 5
- Not found
If the provided zip does not have any mapping.
`bash`
npm install && npm test
`bash`
npm run publish
> Note: Do not forget to update the version using npm version` command!