1.6.0 • Published 4 years ago

tidesandcurrents v1.6.0

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

NOAA Tides and Currents API

Node wrapper around the NOAA Tides and Currents API.

Usage

yarn add tidesandcurrents

get(stationId: number, params?: {})

Make a generic call to the tides and currents API. All params valid to pass can be found here.

import tidesandcurrents from 'tidesandcurrents'

// the `now` method returns today's date as 'yyyymmdd'.
const currentAirTemperature = tidesandcurrents.get(8410140, {
  product: 'air_temperature',
  date: tidesandcurrents.now
});

tidePredictions(stationId: number, date?: string)

Get the day's high/low tide predictions. Date param defaults to today.

import tidesandcurrents from 'tidesandcurrents'

// date defaults to today
const tidePredictions = tidesandcurrents.tidePredictions(8410140)

// or you can specify a past/future date
const yesterdaysTidePredictions = tidesandcurrents.tidePredictions(8410140, '20201231')

// returns an array of the day's predictions
// [
//   { t: '2020-08-05 00:26', v: '19.640', type: 'H' },
//   { t: '2020-08-05 06:53', v: '-0.412', type: 'L' },
//   { t: '2020-08-05 12:54', v: '18.423', type: 'H' },
//   { t: '2020-08-05 19:10', v: '0.786', type: 'L' }
// ]

stationMetadata(stationId: number)

Gets station metadata info -- id, name, latitude, and longitude.

import tidesandcurrents from 'tidesandcurrents'

const stationMetadata = tidesandcurrents.stationMetadata(8410140)

// returns
// {
//   id: '8410140',
//   name: 'Eastport',
//   state: 'ME',
//   latitude: '44.9046',
//   longitude: '-66.9829'
// }

currentWaterLevel(stationId: number)

Gets the current water level for a given station.

import tidesandcurrents from 'tidesandcurrents'

const currentWaterLevel = tidesandcurrents.currentWaterLevel(8410140)

// return
// {
//   "f": "0,0,0,0",
//   "q": "p",
//   "s": "0.072",
//   "t": "2020-08-06 16:06",
//   "v": "7.151",
// }
1.6.0

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.4.8

4 years ago

1.4.7

4 years ago

1.3.1

4 years ago

1.2.2

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago