1const request = require("request");
2
3request.get("https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD,EUR,CNY,JPY,GBP", function(error, response, body) {
4 if (error)
5 throw error;
6 else if (!response)
7 throw new Error("no response");
8 else if (response.statusCode != 200)
9 throw new Error("bad response");
10 else
11 console.log(JSON.stringify(JSON.parse(body), null, 4));
12});
13