An open API service indexing awesome lists of open source software.

https://github.com/ringsaturn/tzf-wasm


https://github.com/ringsaturn/tzf-wasm

tzf

Last synced: 6 months ago
JSON representation

Awesome Lists containing this project

README

        

# `tzf-wasm` [![NPM Version](https://img.shields.io/npm/v/tzf-wasm)](https://www.npmjs.com/package/tzf-wasm)

A fast library to find the timezone of a given location using WebAssembly for
JavaScript, powered by [`tzf-rs`](https://github.com/ringsaturn/tzf-rs).

## Use in HTML

```html




tzf-web Example

import init, {
WasmFinder,
} from "https://www.unpkg.com/[email protected]/tzf_wasm.js";

let finder;

async function loadWasm() {
await init();
finder = new WasmFinder();
const lng = -74.0060;
const lat = 40.7128;
const timezone = finder.get_tz_name(lng, lat);
console.log(`Timezone for (${lat}, ${lng}): ${timezone}`);
}

loadWasm();


```

For a simple web page, see .

## LICENSE

This project is licensed under the [MIT license](./LICENSE). The data is
licensed under the
[ODbL license](https://github.com/ringsaturn/tzf-rel/blob/main/LICENSE), same as
[`evansiroky/timezone-boundary-builder`](https://github.com/evansiroky/timezone-boundary-builder)