@kuuki/luftdaten
v1.1.3
Published
A simple api wrapper written in typescript for luftdaten
Maintainers
Readme
kuuki/luftdaten is a simple API wrapper for Luftdaten, written in TypeScript.
More info on Luftdaten APIs here.
This library provides the following functionality:
- [x] Retrieve all latest (5min) measurements.
- [x] Retrieve all latest measurements with
sensor typefilter. - [x] Retrieve all latest measurements with
areafilter. - [x] Retrieve all latest measurements with
boxfilter. - [x] Retrieve all latest measurements with
countryfilter. - [x] Retrieve an average of all latest measurements of a sensor (5min).
- [x] Retrieve an average of all measurements of a sensor (1h).
- [x] Retrieve an average of all measurements of a sensor (24h).
- [x] 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/luftdatenUsage
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.
