1.0.1 • Published 6 months ago

dwd-warn v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

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.

1.0.1

6 months ago

1.0.0

6 months ago