Promiseでrssの取得
code:js
const promise = new Promise(
(resolve, reject) => {
http.get(url, (res) => {
let body = "";
res.on("data", (chunk) => {
body = body + chunk.toString();
});
res.on("end", () => {
resolve(body);
});
});
}
);
function myFunc() {
promise.then((element) => {
//何らかの処理
})
}
myFunc();
ベータロー.icon複雑で分かりにくい、、、