GithubHelp home page GithubHelp logo

gretzky / tidesandcurrents Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 159 KB

node wrapper for the NOAA Tides and Currents API

License: MIT License

TypeScript 100.00%
noaa tides tidesandcurrents noaa-api

tidesandcurrents's Introduction

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",
// }

tidesandcurrents's People

Contributors

gretzky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.