Skip to content
Neaps

A Javascript tide height predictor.

Many agencies like NOAA provide high-quality tide data and prediction services. But these services require online access, and are not available for every country.

Neaps uses standard algorithims to predict tide levels anywhere that has well-defined harmonic constituents. This is useful for:

  • Offline access
  • Faster processing for multiple locations
  • Predicting in areas with no well-built APIs

How it compares

Here's a chart comparing Neaps, NOAA prediction, and actual observed water levels for Monterey, California. View other comparisons.

Red is Neaps, dark blue is NOAA, and light blue is observed water levels.

Installation

Install with your favorite package manager.

# yarn
yarn install @neaps/tide-prediction
#npm
npm install --save @neaps/tide-prediction

Basic Usage

import TidePrediction from "@neaps/tide-prediction";
const constituents = [
{
phase_GMT: 98.7,
phase_local: 313.7,
amplitude: 2.687,
name: "M2",
speed: 28.984104
}
//....there are usually many, read the docs
];
const highLowTides = tidePrediction(constituents, {
phaseKey: "phase_GMT"
}).getExtremesPrediction({
start: new Date("2019-01-01"),
end: new Date("2019-01-10")
});