Socket
Socket
Sign inDemoInstall

react-cached-forecast

Package Overview
Dependencies
96
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-cached-forecast

Weather forecast app based on React and with server caching to minimize forecast API calls


Version published
Weekly downloads
4
Maintainers
1
Created
Weekly downloads
 

Readme

Source

React weather forecast with caching

Weather forecast app based on React and with server caching to minimize forecast API calls.

The app takes arguments like latitude, longitude, language, units, and other parameters from the ForecastIO API and returns a HTML string with the weather forecast for the region like:

Demo here

Usage example

Server side code:

let API = require('react-cached-forecast');
let forecastKey = require('../config/keys'); // or where you have the keys
let forecast = new API(forecastKey, {units: 'si'});


app.get('/', function(req, res){
	const lat = req.query.lat;
	const lng = req.query.lng;
	const options = {lang: 'sv'};

	forecast.get(lat, lng, options).then(html => {
		res.send(html);
	});
});

In the client I'm using Skycons for the animations. Check the demo or open a issue if you have questions.

App defaults

Units default to si (european), check the Forecast docs for other units.

Language defaults to en.
Place name defaults to Timezone region. Otherwise set placeName in the options.

Keywords

FAQs

Last updated on 26 Jul 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc