1.1.3 • Published 6 years ago
@kuuki/luftdaten v1.1.3
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 typefilter. - Retrieve all latest measurements with
areafilter. - Retrieve all latest measurements with
boxfilter. - Retrieve all latest measurements with
countryfilter. - 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/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.