"use strict";
//const request = request('request');
exports.__esModule = true;
// import * as request from 'request';
// const url = 'https://api.exchangeratesapi.io/latest';
// let result = '';
// request.get(url)
//     .on('respose', res => {
//         console.log(`statusCode = ${res.statusCode}`);
//     })
//     .on('data', data => {
//             console.log("ได้ข้อมูล")
//         result += data;
//     })
//     .on('end', res => {
//         console.log('yess');
//         console.log(result);
//         const exchange = JSON.parse(result);
//         console.log(exchange.rates);
//     })
var axios_1 = require("axios");
axios_1["default"]
    .get("https://api.exchangeratesapi.io/latest")
    .then(function (response) {
    var r = response.data.rates;
    console.log("\u0E40\u0E07\u0E34\u0E19 100 \u0E1A\u0E32\u0E17 = " + 100 * r.USD / r.THB + " USD");
})["catch"](function (err) {
    console.error(err);
});
