Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Latest commit

 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tzf-node: A Node.js binding of tzf-rs CI

Note

  1. This package uses a simplified polygon data and not so accurate around borders.
  2. The timezone data size has been optimized, about 5MB to download and use about 40MB memory.

Install

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 ✓ ✓ ✓

Performance

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!

Development

  • Install the latest Rust
  • Install Node.js@10+ which fully supported Node-API
  • Install yarn@1.x

Test

  • yarn
  • yarn build
  • yarn test

And you will see:

  ✔ sync getTz (237ms)
  ✔ run all cities (201ms)
  ─

  2 tests passed

Release package

npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]

git push

LICENSE

MIT

The binary timezone data behind is licensed ODbL-1.0 license, same as upsteam timezone-boundary-builder/DATA_LICENSE

About

A Node.js binding of tzf-rs

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages