Skip to content

guillaumewuip/pluie-dans-l-heure

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

pluie-dans-l-heure Build Status

Package nodejs pour interroger la fonction Pluie dans l'heure de Météo France

Install

npm install pluie-dans-l-heure

Use

const rain = require('pluie-dans-l-heure');

rain
    .get(44019)
    .then((res) => {

        //do something

    })
    .catch((err) => {

        if (err.message === 'no data') {
            return console.log('something wrong with id');
        }

        console.error(err);
    });

Documentation

rain.get(id)

Params :

  • id : code INSEE du lieu

Returns : Promise. When it resolves :

{
    raw: <request result>,
    idLieu: <String>,    //INSEE id
    lastUpdate: <Date>,  //data update date
    validity: <Date>,    //validity date
    raining: <Boolean>,  //is it raining now ?
    willRain: <Boolean>, //rain in the next hour ?
    windows: [           //12 5min-window with rain status
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    ],
    confidence: 0       //[0-1] number of confidence
}

rain.NO_DATA=0

rain.NO_RAIN=1

rain.LIGHT_RAIN=2

rain.MODERATE_RAIN=3

rain.HEAVY_RAIN=4

rain.request(id)

Params :

  • id : code INSEE du lieu

Returns : Promise. When it resolves, gives you the JSON output of the HTTP request.

About

Package nodejs pour interroger la fonction Pluie dans l'heure de Météo France

Resources

License

Stars

Watchers

Forks

Packages

No packages published