npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tempoch-js

v0.1.0

Published

high-precision, type-safe time computations. Provides strongly-typed time units, durations, and arithmetic with compile-time guarantees, enabling robust temporal calculations for scientific and systems software.

Downloads

106

Readme

tempoch-js workspace

JavaScript and WebAssembly bindings for tempoch, the Siderust astronomical time library.

This repository is the publishable JS workspace. It contains the npm packages, the thin Rust transport layers for Node and Web, and the vendored tempoch workspace that provides the canonical time-scale, epoch, and period logic.

Packages

| Package | Target | Status | Notes | | --- | --- | --- | --- | | @siderust/tempoch | Node.js | 0.1.0 | Native addon built with napi-rs; uses @siderust/qtty@^0.1.0 for quantity objects in the JS API. | | @siderust/tempoch-web | Browsers / bundlers | 0.1.0 | WebAssembly build with wasm-bindgen; requires await init() and uses @siderust/qtty-web@^0.1.0 for quantity objects in the API. |

The Rust crates under tempoch-node/ and tempoch-web/ are transport layers only. All astronomical time semantics come from the vendored tempoch workspace.

Repository layout

tempoch-js/
├── tempoch/       Vendored Rust workspace (canonical time logic)
├── tempoch-node/  Node package: @siderust/tempoch
├── tempoch-web/   Browser package: @siderust/tempoch-web
└── scripts/       CI helpers for the Node package

What ships in 0.1.0

  • A Node package exposing JulianDate, ModifiedJulianDate, Period, UTC conversion helpers, and epoch arithmetic utilities.
  • A browser/WASM package exposing the same core time model with explicit async initialization via init().
  • JS APIs that interoperate with the published qtty-js 0.1.0 line, using @siderust/qtty and @siderust/qtty-web quantity objects for durations and day-count results.
  • TypeScript declarations for both packages matching the runtime surface.
  • Node examples, tests, and CI for format, lint, build, test, and coverage.

Install

Node.js

npm install @siderust/tempoch @siderust/qtty
const { JulianDate } = require('@siderust/tempoch');
const { Hours } = require('@siderust/qtty/units');

const jd = JulianDate.j2000();
const later = jd.add(Hours(6));
console.log(later.toDate().toISOString());

Browser / WebAssembly

npm install @siderust/tempoch-web @siderust/qtty-web
import { init, JulianDate } from '@siderust/tempoch-web';
import { Quantity } from '@siderust/qtty-web';

await init();

const jd = JulianDate.j2000();
const later = jd.add(new Quantity(6, 'Hour'));
console.log(later.toDate().toISOString());

Development

Clone the repository with submodules so the vendored Rust workspace is present:

git clone --recurse-submodules [email protected]:Siderust/tempoch-js.git
cd tempoch-js

If you already cloned without submodules:

git submodule update --init --recursive

Node package workflow

cd tempoch-node
npm ci
npm run build:debug
npm test

The repository also exposes CI helpers:

./scripts/ci.sh all

Web package workflow

tempoch-web uses wasm-pack:

cd tempoch-web
wasm-pack build --target web --out-dir pkg --release --scope siderust

Related documentation

License

AGPL-3.0. See LICENSE.