Documentation / @interstellar-tools/temporal
@interstellar-tools/temporal
Time and epoch utilities for space applications, from attoseconds to gigayears, with unit normalisation and conversion that the rest of the stack builds on.
Documentation
The full documentation lives at phun-ky.net/interstellar-tools:
- Getting started: installation, unit conventions and recommended practices
- API reference for
@interstellar-tools/temporal: every export, with formulas, parameters and examples
Installation
- Node.js version 22.9.0 or higher
shell
npm i --save @interstellar-tools/temporalVariables
| Variable | Description |
|---|---|
| NORMALIZE_TEMPORAL_UNIT | Lookup table that normalizes user-facing time unit aliases (and the canonical symbols themselves) to a single, canonical TemporalUnitType. |
| SECONDS_PER | Seconds-per-unit lookup for all canonical TemporalUnitType symbols. |
Functions
| Function | Description |
|---|---|
| convertTemporalUnit | Convert a temporal duration between any two canonical TemporalUnitType units. |
| normalizeTemporalUnit | Normalize a user-provided temporal unit string into a canonical TemporalUnitType. |