1.1.3 • Published 5 years ago

@kuuki/luftdaten v1.1.3

Weekly downloads
7
License
ISC
Repository
-
Last release
5 years ago

lerna GitHub Coverage Status

kuuki/luftdaten is a simple API wrapper for Luftdaten, written in TypeScript.

More info on Luftdaten APIs here.

This library provides the following functionality:

  • Retrieve all latest (5min) measurements.
  • Retrieve all latest measurements with sensor type filter.
  • Retrieve all latest measurements with area filter.
  • Retrieve all latest measurements with box filter.
  • Retrieve all latest measurements with country filter.
  • Retrieve an average of all latest measurements of a sensor (5min).
  • Retrieve an average of all measurements of a sensor (1h).
  • Retrieve an average of all measurements of a sensor (24h).
  • Strictly typed models.

About

This library focuses on providing a strictly typed API wrapper. If you need something more sophisticated - check out @kuuki/lufdaten-events, that exposes EventEmitter and emits events accordingly.

Installation

@kuuki/luftdaten requires Node.js to run on the backend.

$ npm install --save @kuuki/luftdaten

Usage

const luftdaten = require("@kuuki/luftdaten");

const ld = new luftdaten.LuftdatenService();

(async () => {
  const measurements = await ld.getLatestMeasurements();
  measurements.forEach(m => {
    console.log(m)
  });
})();

Documentation

Generated docs are placed in the root /docs folder, you can preview them under this link, however the d.ts files should do just fine if you have your code editor and environment set up correctly.