# windows-iana

> A small tool to convert between Windows time zones and IANA

Latest version **5.1.0** (published 2021-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install windows-iana
pnpm add windows-iana
yarn add windows-iana
bun add windows-iana
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.1.0 |
| Published | 2021-10-20 |
| First published | 2017-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 983.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | rubenillodo |
| Keywords | Time Zone, IANA, Windows Time Zone |

## Links

- npm: https://www.npmjs.com/package/windows-iana
- Repository: https://github.com/rubenillodo/windows-iana
- Homepage: https://github.com/rubenillodo/windows-iana#readme
- Issues: https://github.com/rubenillodo/windows-iana/issues
- npm.io page: https://npm.io/package/windows-iana

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 5.1.0 (latest) — 2021-10-20
- 5.0.2-alpha.1 (alpha) — 2021-04-20
- 5.0.2 — 2021-04-20
- 5.0.1 — 2021-03-01
- 5.0.0 — 2021-01-29
- 5.0.0-alpha.1 — 2021-01-29
- 4.2.1 — 2020-09-02
- 4.2.0 — 2019-12-02
- 4.1.0 — 2019-08-22
- 4.0.0 — 2019-08-17
- 3.1.0 — 2019-05-28
- 3.0.0 — 2019-03-14
- 2.0.1 — 2017-10-19
- 2.0.0 — 2017-10-18
- 1.0.1 — 2017-10-18
- … 1 more at https://npm.io/package/windows-iana/versions

## README

This library exports two functions to help convert from Windows time zones to IANA time zones (based
on
[this mapping definition](https://github.com/unicode-org/cldr/blob/master/common/supplemental/windowsZones.xml)
and
[this list of IANA aliases](https://github.com/unicode-org/cldr/blob/master/common/bcp47/timezone.xml)).

## Installation

Add the dependency to your project with `npm install --save windows-iana` or
`yarn add windows-iana`.

## Compatibility

The library should work on Node.js >= 12 and all modern broswers. However, it does use
[`[].flat()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat),
which is not supported on IE and would require a polyfill.

## Usage

The library exports:

- [`findIana()`](#findIana): returns an array of possible IANA time zones (including all their
  aliases) for a given Windows zone.
- [`findWindows()`](#findWindows): returns an array of possible Windows time zones for a given IANA
  zone and all its aliases.
- [`findIanaAliases()`](#findIanaAliases): returns an array of IANA aliases for a given IANA zone
  name, including the one passed as a parameter.
- `IANA_ALIAS_MAP`: the IANA alias map used by the library.
- `WINDOWS_TO_IANA_MAP`: the Windows to IANA map used by the library.

### `findIana()`

```ts
import { findIana } from 'windows-iana';

const result = findIana('Romance Standard Time');
console.log(result); // ['Europe/Paris', 'Europe/Brussels', 'Europe/Copenhagen', 'Europe/Madrid', 'Africa/Ceuta']
```

### `findWindows()`

```ts
import { findWindows } from 'windows-iana';

const result = findWindows('America/New_York');
console.log(result); // ['Eastern Standard Time']
```

### `findIanaAliases()`

```ts
import { findIanaAliases } from 'windows-iana';

const result = findIanaAliases('Asia/Ho_Chi_Minh');
console.log(result); // ['Asia/Saigon', 'Asia/Ho_Chi_Minh']
```

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