Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Fetch buoy and tide information from government NDBC data using JavaScript.

License

NotificationsYou must be signed in to change notification settings

derekdowling/buoy-kit

Repository files navigation

Fetch data about buoys in the ocean with JavaScript (or TypeScript) using NOAA data sources.

yarn add buoy-kit

Usage

fetchBuoyRealTimeData fetches, parses, and returns realtime2 station data (.txt extension):

import { fetchBuoyRealTimeData, BuoyData } from 'buoy-kit';export async function getBuoy(buoyID: string): Promise<BuoyData> {  let buoyData: BuoyData;    try {    buoyData = await fetchBuoyRealTimeData(buoyID: string);  } catch (e) {    console.log(e);  }    return buoyData;}

Finding A Buoy

There are plans to make iteasy to find the closest buoy(s) to a nearby location. In the mean time, you can explore the world-wide buoy map on theNDBC site and clicking on one of the squares. The number of the "Station" is the Buoy ID you would use.

On The Server (Node.js)

This library uses theFetch API to manageHTTP requests. You'll want to importisomorphic-fetch ifyou're using this library in a Node environment.

yarn add isomorphic-fetch

Then in your server's initialization file, polyfill Fetch via:

require('isomorphic-fetch');

About

Fetch buoy and tide information from government NDBC data using JavaScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp