dwd-warn

1.0.1 • Public • Published

dwd-warn

Unofficial api for official DWD warnings. Uses the official JSONP warn file which is located here. Warnings are always up to date with a maximum delay of 10 minutes. Learn more here.

Starter guide

1. Install the package

Install this package with npm:

npm install dwd-warn

2. Import the package

Inside your nodejs script import the package:

const dwd = require("dwd-warn").default;
// or
import dwd from "dwd-warn";

3. Fetch the warnings!

Fetch the current warnings. This code is asynchronous, it uses Promises, an asynchronous wrapper function is recommended.

async main(){
    const warnings = await dwd.fetchWarnings();
    const ahrweiler_warnings = warnings.filterByRegionName("Kreis Ahrweiler");

    if(ahrweiler_warnings){
        console.log(ahrweiler_warnings);
    }else{
        console.log("No warnings available!");
    }
}

main();

Community

This project is updated on demand. If you have a question, found a bug or similar feel free to ask here.

Readme

Keywords

Package Sidebar

Install

npm i dwd-warn

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

21.2 kB

Total Files

6

Last publish

Collaborators

  • harrydehix