zip-to-timezone
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

zipToTz

This package provides an updated list of US zipcodes from trusted source (2020).

Installation

  npm install --save zip-to-timezone

Import

  const { ZipToTz } = require('zip-to-timezone');
  // OR
  import { ZipToTz } from 'zip-to-timezone';

Usage

  try {
    const tz = new ZipToTz().full('33487'); // America/New_York
    const tz = new ZipToTz().short('33487'); // EDT 
  } catch(error) {
    // handler error  
  }

Error Messages

  • 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.

build and test

npm install && npm test

publish

npm run publish

Note: Do not forget to update the version using npm version command!

Package Sidebar

Install

npm i zip-to-timezone

Weekly Downloads

1,322

Version

1.2.1

License

ISC

Unpacked Size

1.64 MB

Total Files

10

Last publish

Collaborators

  • pmmonier