Note
- This package uses a simplified polygon data and not so accurate around borders.
- The timezone data size has been optimized, about 5MB to download and use about 40MB memory.
TODO
# Wait for NPM response to my ticket as 'Package name triggered spam detection'
npm install
node14 | node16 | node18 | |
---|---|---|---|
Windows x64 | ✓ | ✓ | ✓ |
Windows x32 | ✓ | ✓ | ✓ |
Windows arm64 | ✓ | ✓ | ✓ |
macOS x64 | ✓ | ✓ | ✓ |
macOS arm64 | ✓ | ✓ | ✓ |
Linux x64 gnu | ✓ | ✓ | ✓ |
Linux x64 musl | ✓ | ✓ | ✓ |
Linux arm gnu | ✓ | ✓ | ✓ |
Linux arm64 gnu | ✓ | ✓ | ✓ |
Linux arm64 musl | ✓ | ✓ | ✓ |
Android arm64 | ✓ | ✓ | ✓ |
Android armv7 | ✓ | ✓ | ✓ |
FreeBSD x64 | ✓ | ✓ | ✓ |
tzf-node is powered by tzf-rs, a Rust library designed for server side high performance use cases. Which means it's not optimized for browser use cases. But you can trust it's performance.
> tzf@0.2.3 bench
> node -r @swc-node/register benchmark/bench.ts
Running "Random Cities" suite...
Progress: 100%
Random getTz:
604 255 ops/s, ±1.77% | fastest
Finished 1 case!
- Install the latest
Rust
- Install
Node.js@10+
which fully supportedNode-API
- Install
yarn@1.x
- yarn
- yarn build
- yarn test
And you will see:
✔ sync getTz (237ms)
✔ run all cities (201ms)
─
2 tests passed
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
git push
The binary timezone data behind is licensed
ODbL-1.0 license,
same as upsteam
timezone-boundary-builder/DATA_LICENSE