{"size": 498, "ext": "js", "max_stars_repo_path": "parser.js", "max_stars_repo_name": "Xn2/tamRaspiDisplay", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "parser.js", "max_issues_repo_name": "Xn2/tamRaspiDisplay", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "parser.js", "max_forks_repo_name": "Xn2/tamRaspiDisplay", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.9, "max_line_length": 101, "alphanum_fraction": 0.6084337349}
const axios = require("axios");
const fs = require("fs");

function fetchCSV(){
    return new Promise(function(resolve, reject){
        axios.get("https://data.montpellier3m.fr/sites/default/files/ressources/TAM_MMM_TpsReel.csv")
        .then(function(result){
            resolve(result);
        })
        .catch(function(err){
            reject(result);
        });
    });
}

fetchCSV()
.then(function(csv){
    console.log(csv);
    fs.writeFileSync('result.csv', Object.entries(csv));
})