Package Exports
- airly
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (airly) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Airly ☁️
Simple wrapper for Airly API
Highlights
- Simple API
- Uses async/await
- Uses the 2.0 version of Airly API
- Actively maintained
- Lightweight
- Less than 100 lines of code
Install
$ npm install airly
Usage
const Airly = require('airly');
const airly = new Airly('API_KEY');
(async () => {
try {
const data = await airly.idInfo(240);
console.log(data);
} catch (error) {
console.log(error);
}
})();API
Check out the
examplesfolder 🚀
new Airly(key, language)
Constructor for other operations
key
Type: string
Your Airly API key. You can obtain one here.
language
Type: string
Default: en
Get air quality descriptions in specified language. Currently supported languages are English ('en' - default) and Polish ('pl').
For more information check out Airly's documentation
airly.idData(id)
Returns pollution data from the specified installation
id
Type: number
Unique number of the installation
airly.idInfo(id)
Returns information about the specified installation
id
Type: number
Unique number of the installation
airly.nearestInstallations(lat, lng)
Returns information about 3 nearest installations (including their ID's)
lat
Type: number
Latitude
lng
Type: number
Longitude
License
MIT © Antoni Kepinski