0.2.3 • Published 6 years ago

owm-toolkit v0.2.3

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

OpenWeatherMap Toolkit

Toolkit to reduce pain using OpenWeatherMap API.

Why are there so few methods?

It's because of OWM API free plan limitations. This toolkit is mainly built for beginners doing the common weather application test tasks.

Usage

All examples related to Saint-Petersburg, Russia. Its ID on OpenWeatherMap is 498817.

For more details check out API reference.

Install dependency

npm install owm-toolkit --save

Or you can use Yarn (which is faster):

yarn add owm-toolkit

Initialize OWMToolkit instance

import { OWMToolkit } from 'owm-toolkit';

const owm = new OWMToolkit('myApiKey');

General usage of any method (examples below are without .then() and .catch())

owm.SOME_METHOD(498817)
  .then(res => console.log(res))
  .catch(err => console.error(err));

Get current weather data

owm.getCurrent(498817)

Get 5 day / 3 hour forecast

owm.getThreeHours(498817)

Find city

owm.findCity('Saint Petersburg, RU')