Code Monkey home page Code Monkey logo

rainman's Introduction

Rainman

A small library to get weather data. Currently only supports OpenWeatherMap.

Usage

import Rainman from 'rainman';

const rainman = new Rainman({ key: 'YOUR_API_KEY' });

rainman.get([0, 0]).then(response => {
  console.log(response);
});

Options

option type required? default notes
key string โœ” You can get this from OpenWeatherMap.
accuracy number 2 This rounds your latitude and longitude to the corresponding number of decimal places. e.g., [40.293480, -29.307948] will be rounded to [40.29, -29.31] at an accuracy of 2. This helps in caching requests and will work just fine if you don't need extremely specific weather data.
cache boolean true Turning this off will mean that no API calls will be cached. Turn off at your own risk, as you may be charged for extra API calls!
ttl number 1 hour (60*60*60) Time To Live for cached requests
units `'metric' 'imperial'` 'celcius'

Roadmap

  • Integrate extra services (Yahoo, DarkSky)
  • Add a backup provider, in case the default provider times out
  • Give the option to standardise API responses into a single object

rainman's People

Contributors

joemckie avatar greenkeeper[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.