@@ -20,18 +20,18 @@ npm install neaps
2020### Tide Extremes Prediction
2121
2222``` typescript
23- import { getExtremesPrediction } from ' neaps'
23+ import { getExtremesPrediction } from " neaps" ;
2424
2525const prediction = getExtremesPrediction ({
2626 latitude: 26.7 , // or `lat`
2727 longitude: - 80.05 , // or `lng` or `lon`
28- start: new Date (' 2025-12-17' ),
29- end: new Date (' 2025-12-18' ),
30- datum: ' MLLW' , // optional, defaults to MLLW if available
31- units: ' meters' // optional, defaults to 'meters', can also be 'feet'
32- })
28+ start: new Date (" 2025-12-17" ),
29+ end: new Date (" 2025-12-18" ),
30+ datum: " MLLW" , // optional, defaults to MLLW if available
31+ units: " meters" , // optional, defaults to 'meters', can also be 'feet'
32+ });
3333
34- console .log (prediction )
34+ console .log (prediction );
3535// {
3636// datum: 'MLLW',
3737// units: 'meters',
@@ -51,18 +51,18 @@ console.log(prediction)
5151### Get Timeline Prediction
5252
5353``` typescript
54- import { getTimelinePrediction } from ' neaps'
54+ import { getTimelinePrediction } from " neaps" ;
5555
5656const timeline = getTimelinePrediction ({
5757 lat: 26.77 ,
5858 lon: - 80.05 ,
59- start: new Date (' 2025-12-19T00:00:00-05:00' ),
60- end: new Date (' 2025-12-19T01:00:00-05:00' ),
59+ start: new Date (" 2025-12-19T00:00:00-05:00" ),
60+ end: new Date (" 2025-12-19T01:00:00-05:00" ),
6161 timeFidelity: 5 * 60 , // seconds, defaults to `10 * 60`
62- units: ' meters' // optional, defaults to 'meters', can also be 'feet'
63- })
62+ units: " meters" , // optional, defaults to 'meters', can also be 'feet'
63+ });
6464
65- console .log (timeline )
65+ console .log (timeline );
6666// {
6767// datum: 'MLLW',
6868// units: 'meters',
@@ -84,17 +84,17 @@ console.log(timeline)
8484### Get Water Level at Specific Time
8585
8686``` typescript
87- import { getWaterLevelAtTime } from ' neaps'
87+ import { getWaterLevelAtTime } from " neaps" ;
8888
8989const prediction = getWaterLevelAtTime ({
9090 lat: 26.77 ,
9191 lon: - 80.05 ,
92- time: new Date (' 2025-12-19T00:30:00-05:00' ),
93- datum: ' MSL' ,
94- units: ' meters' // optional, defaults to 'meters', can also be 'feet'
95- })
92+ time: new Date (" 2025-12-19T00:30:00-05:00" ),
93+ datum: " MSL" ,
94+ units: " meters" , // optional, defaults to 'meters', can also be 'feet'
95+ });
9696
97- console .log (prediction )
97+ console .log (prediction );
9898// {
9999// datum: 'MSL',
100100// units: 'meters',
@@ -116,41 +116,39 @@ Neaps uses [@neaps/tide-database](https://github.com/neaps/tide-database) to fin
116116#### Nearest Station
117117
118118``` typescript
119- import { nearestStation } from ' neaps'
119+ import { nearestStation } from " neaps" ;
120120
121- const station = nearestStation ({ lat: 26.7 , lon: - 80.05 })
122- console .log (` ${station .name } (${station .source .id }) ` ) // Fort Lauderdale, FL (8722588)
121+ const station = nearestStation ({ lat: 26.7 , lon: - 80.05 });
122+ console .log (` ${station .name } (${station .source .id }) ` ); // Fort Lauderdale, FL (8722588)
123123```
124124
125125Once you've found a station, you can get predictions, timeline, or water level at a specific time for that station:
126126
127127``` typescript
128128// Get extremes prediction for the nearest station
129129station .getExtremesPrediction ({
130- start: new Date (' 2025-12-17' ),
131- end: new Date (' 2025-12-18' )
132- })
130+ start: new Date (" 2025-12-17" ),
131+ end: new Date (" 2025-12-18" ),
132+ });
133133
134134// Get timeline prediction for the nearest station
135135station .getTimelinePrediction ({
136- start: new Date (' 2025-12-19' ),
137- end: new Date (' 2025-12-20' )
138- })
136+ start: new Date (" 2025-12-19" ),
137+ end: new Date (" 2025-12-20" ),
138+ });
139139
140140// Get timeline prediction for the nearest station
141- station .getWaterLevelAt ({ time: new Date (' 2025-12-19T00:30:00-00:00' ) })
141+ station .getWaterLevelAt ({ time: new Date (" 2025-12-19T00:30:00-00:00" ) });
142142```
143143
144144#### List Nearby Stations
145145
146146``` typescript
147- import { stationsNear } from ' neaps'
147+ import { stationsNear } from " neaps" ;
148148
149149stationsNear ({ latitude: 45.6 , longitude: - 122.7 }, 5 ).forEach ((s ) => {
150- console .log (
151- ` ${s .name } (${s .source .id }) - ${(s .distance / 1000 ).toFixed (2 )} km away `
152- )
153- })
150+ console .log (` ${s .name } (${s .source .id }) - ${(s .distance / 1000 ).toFixed (2 )} km away ` );
151+ });
154152// Vancouver (9440083) - 3.49 km away
155153// Portland Morrison Street Bridge (9439221) - 10.24 km away
156154// KNAPP(THORNES)LNDG, WILLOW BAR (9440171) - 16.34 km away
@@ -161,13 +159,13 @@ stationsNear({ latitude: 45.6, longitude: -122.7 }, 5).forEach((s) => {
161159#### Find station by ID
162160
163161``` typescript
164- import { findStation } from ' neaps'
162+ import { findStation } from " neaps" ;
165163
166164// Find station by Neaps ID
167- findStation (' us-wa-seattle' ) // Seattle
165+ findStation (" us-wa-seattle" ); // Seattle
168166
169167// Find station by source ID (e.g. NOAA)
170- findStation (' 9440083' ) // Vancouver
168+ findStation (" 9440083" ); // Vancouver
171169```
172170
173171## Accuracy & Validation
0 commit comments