npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

weather-ireland-js

v1.0.1

Published

A module for obtaining irish weather forecast information from Met Eireann's Weather Forecast API

Downloads

7

Readme

weather-ireland-js

Simple APIs to return weather forecast informaion from around Ireland using Met Eireanns Forecast API https://data.gov.ie/dataset/met-eireann-weather-forecast-api

Build Status

Intro

Simple Javascript friendly abstraction layer on top of Met Eireanns XML based weather forecast service. The world needs no more angle brackets !

Installation

npm install weather-ireland-js

Getting Started

const weatherAPI = require("weather-ireland-js");

// pass a valid latitude and longitude for anywhere in ireland
var forecasts = await weatherAPI.getForecast(54.7210798611, -8.7237392806);
forecasts.forEach((weatherForecast) => {
  console.log(weatherForecast);
});

Current Weather Data

var forecasts = await weatherAPI.getForecast(54.7210798611, -8.7237392806);
forecasts.forEach((weatherForecast) => {
  console.log(weatherForecast);
});

//how to the current forecast
let currentWather = forecast.find(
  (o) =>
    DateTime.fromISO(o.to).diff(now, ["hours"]).toObject().hours > 0 &&
    DateTime.fromISO(o.to).diff(now, ["hours"]).toObject().hours <= 1
);
console.log("The current weather forecast is...");
console.log(JSON.stringify(currentWeather));

API Response Format

[
{"from":"2021-03-25T00:00:00.000+00:00",
"to":"2021-03-25T00:00:00.000+00:00",
"temperature_celsius":"1.3",
"windDirectionName":"NW",
"windDirectionDegree_degrees":"329.6",
"windSpeed_mps":"0.9",
"windSpeed_kph":3.2399999999999998,
"pressure":"1017.9",
"cloudiness_percentage":"95.0",
"rain_mm":"0.0",
"weatherSymbol_descriptionID":"Cloud",
"weatherSymbol_number":"4"},
..
]

| Property | Description | | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | from | Content Cell | | to | Content Cell | | temperature_celsius | The air temperature 2m above the ground is given in degrees Celsius | | windDirectionName | The cardinal direction i.e. southwest SW. | | windDirectionDegree_degrees | The direction of the wind is given in degrees from 0 to 360 | | windSpeed_mps | Wind speed metres per second | | windSpeed_kph | Wind speed kilometres per hour | | pressure | Pressure is given in units of hPa | | cloudiness_percentage | The general level of cloudiness 0-100 | | rain_mm | predicted rainfall in millimetres (mm). | | weatherSymbol_descriptionID | The WDB computes the weather symbol for this period of time | | weatherSymbol_number | The weather symbol is derived from a combination of temperature, humidity, cloud cover & precipitation ranges from 1-50 as per Norwegian Meteorological Institute - more info here https://github.com/amedia/meteo-icons |

Test

	npm run test

Met Éireann Custom Open Data Licence

please refer to fill license agreement from Met Eireann here

https://www.met.ie/cms/assets/uploads/2018/05/Met-%C3%89ireann-Open-Data-Custom-Licence_Final.odt

TLDR-

  • You must give appropriate credit to Met Éireann, provide a link to the licence, and indicate if changes were made.

  • No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the licence permits.

  • If you distribute or broadcast this data or use this data to create web content for the internet, you must also display our Weather Warnings. Please see here for details on how to access Weather Warnings: https://data.gov.ie/dataset/weather-warnings