You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

zip-to-timezone

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zip-to-timezone

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

1.2.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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!

Keywords

zipcode

FAQs

Package last updated on 05 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts