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

@u-b/tides-core

v0.1.0

Published

Harmonic tide prediction engine with timezone-correct station API, fitted for St Helier, Jersey

Readme

@u-b/tides-core

Zero-dependency harmonic tide prediction. Ships a generic harmonic engine plus a St Helier (Jersey) station whose constituents are fitted to the States of Jersey published tide tables. ESM-only, TypeScript types included.

pnpm add @u-b/tides-core

Quickstart

The St Helier station is ready to use — no setup, no network:

import { stHelier } from '@u-b/tides-core/stations/st-helier'

// Height now, whether the tide is rising, and the next high/low.
const { height, rising, nextExtreme } = stHelier.currentLevel()
//    height: metres above chart datum
//    rising: boolean
//    nextExtreme: { time: Date, height: number, type: 'high' | 'low' } | null

// Every high/low for a calendar day (in the station's timezone, Europe/Jersey).
const events = stHelier.dayExtremes(new Date())
for (const e of events) {
  console.log(e.type, e.time.toISOString(), e.height.toFixed(2))
}

// Evenly spaced heights across a day — handy for plotting a curve.
const curve = stHelier.timeline(new Date(), 6) // 6 points/hour

currentLevel, dayExtremes, timeline, levelAt, slopeAt and extremes are all documented on the Station type.

Other stations

Bring your own harmonic constants and reckon days in any timezone:

import { createStation } from '@u-b/tides-core'

const station = createStation({
  id: 'my-port',
  name: 'My Port',
  latitude: 49.0,
  longitude: -2.0,
  timeZone: 'Europe/Jersey', // calendar days are reckoned here
  datum: 5.9,                 // metres added to predictor output (chart datum)
  constituents: [
    // { name, amplitude (m), phase_GMT (deg) }
    // name must be one of the built-in CATALOG constituents (M2, S2, N2, K1, ...)
    // ...your fitted or published harmonic constants
  ]
})

Constituent names must exist in the engine's built-in CATALOG (exported for inspection) — createStation throws Unknown constituents: ... for any name it does not recognise. Speeds and nodal corrections come from the catalog; you supply only amplitude and Greenwich phase lag (phase_GMT).

The sun/moon almanac (pure NOAA sun position + Meeus moon phase, no dependencies) is a separate entrypoint:

import { getSunTimes, getMoonPhase } from '@u-b/tides-core/almanac'

Accuracy

St Helier predictions were checked against 931 official events from the States of Jersey tables (cross-verified against gov.je / NOC and SHOM):

| Metric | Mean | Max | | ------- | -------- | -------- | | Timing | 1.2 min | 4.3 min | | Heights | 0.11 m | 0.39 m |

Provenance

Constituents derived by harmonic fit to States of Jersey published tide tables. Predictions are computed locally and are NOT for navigation.

License

MIT