(async () => { try { const translatte = require('translatte'); const axios = require('axios'); const fs = require('fs'); let input = Buffer.from(process.argv[2], 'base64').toString(); let w_in = (await translatte(input, {from: 'fr', to: 'en'})).text; let key = fs.readFileSync("./wolframkey").toString(); let response = (await axios.get(`https://api.wolframalpha.com/v1/result?appid=${key}&i=${encodeURI(w_in)}&units=metric&timeout=10`)).data let w_out = (await translatte(response, {from: 'en', to: 'fr'})).text; console.log(w_out.replace(/([0-9]+)\.([0-9]+)/gm, "$1,$2")); process.exit(); } catch (e) { if (e.message === "Request failed with status code 501") { process.exit(5); } else { console.log("Désolé, je ne parviens pas à accéder à Internet en ce moment. Vérifiez que votre appareil dispose d'une connexion Internet stable et réessayez."); process.exit(); } } })()