yr-lib

1.0.20 • Public • Published

Yr.no library

A simple library to call the Yr.no XML based api and return response in JSON

Installation

cd root project
$ npm install yr-lib

Usage

ES5

var LocationForecast = require('yr-lib').LocationForecast;
LocationForecast(lat, lon,function(data) {
    //do something with data  
});
 

ES6

import { LocationForecast } from 'yr-lib';
LocationForecast(lat, lon, data => {
    //do something with data      
});

Get weather in current day and time

ES5

var CurrentLocationForecast = require('yr-lib').CurrentLocationForecast;
CurrentLocationForecast(lat, lon, local_time, time_diff_hour, function(data) {
    //do something with data  
});
 

ES6

import { CurrentLocationForecast } from 'yr-lib';
CurrentLocationForecast(lat, lon, local_time, time_diff_hour, data => {
    //do something with data      
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.20
    4
    • latest

Version History

Package Sidebar

Install

npm i yr-lib

Weekly Downloads

4

Version

1.0.20

License

ISC

Last publish

Collaborators

  • m.almouallem