1.2.0 • Published 4 years ago
@kuuki/gios v1.2.0
@kuuki/gios
is a simple api wrapper for GIOS written in TypeScript.
GIOS stands for (CHIEF INSPECTORATE FOR ENVIRONMENTAL PROTECTION).
This library provides the following functionality:
- Retrieve all measurement stations.
- Retrieve all measurement station sensors.
- Retrieve latest measurements of a sensor (up to 24h back) with time series granularity of 1 hour.
- Retrieve air quality index for a station.
About
This library focuses on providing a strictly typed API definition.
If you need something more, check out @kuuki/gios-events
Installation
@kuuki/gios
requires Node.js to run on the backend.
$ npm install --save @kuuki/gios
Usage
const gios = require("@kuuki/gios");
// use with async await
(async() => {
const api = new gios.GiosAirQualityService();
const measurements = await api.getMeasurements(88);
console.log(measurements);
})();
// use with Promises
const api = new gios.GiosAirQualityService();
api.getMeasurements(88).then((measurements) => {
console.log(measurements);
});
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.
Gios API
The official API docs can be viewed at Gios.