# fast-timezone

> Fast timezone lookup service.

Latest version **1.0.0** (published 2018-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install fast-timezone
pnpm add fast-timezone
yarn add fast-timezone
bun add fast-timezone
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-04-20 |
| First published | 2018-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7 |
| Dependencies | 7 |
| Unpacked size | 20.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Maintainers | arneseib-windy, ilblog, tomas.zamecnik |
| Keywords | time zone, timezone, coordinates, longitude, latitude, nautical |

## Links

- npm: https://www.npmjs.com/package/fast-timezone
- Repository: https://github.com/windycom/fast-timezone
- Homepage: https://github.com/windycom/fast-timezone#readme
- Issues: https://github.com/windycom/fast-timezone/issues
- npm.io page: https://npm.io/package/fast-timezone

## Dependencies (7)

- [pbf](https://npm.io/package/pbf.md) ^3.0.5
- [yauzl](https://npm.io/package/yauzl.md) ^2.9.1
- [geobuf](https://npm.io/package/geobuf.md) ^3.0.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^5.0.0
- [@turf/helpers](https://npm.io/package/@turf/helpers.md) ^6.1.3
- [moment-timezone](https://npm.io/package/moment-timezone.md) ^0.5.15
- [@turf/boolean-point-in-polygon](https://npm.io/package/@turf/boolean-point-in-polygon.md) ^6.0.1

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-04-20
- 0.1.1 — 2018-04-05
- 0.1.0 — 2018-04-05

## README

# fast-timezone

Timezone lookup service.

## About

This is modified version of Evan Siroky's amazing [geo-tz](https://github.com/evansiroky/node-geo-tz/),
but optimized for speed without any compromises.

The approach here is brutally simple: Load everything into memory. Doing so, fast-timezone
will typically consume around 900MB memory extra. Don't even think about using it if you can't
spare at least 1GB of extra memory per process.

## Installation

```bash
npm i fast-timezone
```

## Usage

```JavaScript
const getTimezone = require('fast-timezone');

// It is a good idea to wait until the data is loaded. If any lookups are
// performed before that, an error will be thrown.
await getTimezone.loaded;

// Get a time zone by location:
const zone = getTimezone(50.047, 14.435);
```

Optionally, you can supply a timestamp as the third argument, and you will get the time zone
at that time.

In case a time zone is found (which is the case if the arguments are valid), an object is returned:

```JSON
{
  "id": "Europe/Prague",
  "name": "CEST",
  "offset": 120,
  "designator": "+02:00",
  "type": "t"
}
```

For a nautical time zone the result looks like:

```JSON
{
  "id": "Etc/GMT+3",
  "name": "-03",
  "offset": -180,
  "designator": "-03:00",
  "type": "n"
}
```

where `offset` is the offset in minutes at the moment of the query, and `designator`
is the zone designator according to ISO 8601.

Also note, the type is `n` for nautical time zones.

## License

This software is licenced under the [MIT](https://opensource.org/licenses/MIT) license.

---
_Source: https://npm.io/package/fast-timezone · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
