Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tz-lookup

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tz-lookup

time zone lookup

  • 5.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
50K
increased by5.6%
Maintainers
1
Weekly downloads
 
Created
Source

tz-lookup

This is a little module that allows you to look up the current time zone of a location, given it's latitude and longitude. I wrote it because the existing Node module that does this (tzwhere) was far too slow to be useful in a production setting. This module attempts to ameliorate that.

Usage

To install:

npm install tz-lookup

To use:

> var tzLookup = require("tz-lookup");
> tzLookup(42.7235, -73.6931, function(err, tz) {
>   console.log(tz);
> });
"America/New_York"

There are two data files: a small index file (which is loaded on the first call to tzLookup()) and larger polygon files on disk that are loaded as needed, and then discarded. Performance of any given query will vary depending on its location on the globe, but should be generally high in any case.

Previous versions of this module stored the entire timezone database in RAM. This was inefficient for many use-cases and is no longer done. RAM usage from this module should generally be low.

Regenerating the Database

If you wish to regenerate the database, replace data/tz_world.json with a new version, and run bin/convert. This will update the backing data that this module uses.

tz_world.json should, itself, be a GeoJSON of the global data found on this website: http://efele.net/maps/tz/ It was last updated by us in December 2012.

Keywords

FAQs

Package last updated on 27 Aug 2013

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc