remark plugin to fetch dynamic data from APIs.
npm install remark-requests
const remark = require("remark");
const remarkRequests = require("remark-requests");
remark()
.use(remarkRequests, {
apis: [
{
name: "coindeskApi",
url: "https://api.coindesk.com/v1/bpi/currentprice.json",
},
],
})
.process(
"Chart name: GET(coindeskApi, chartName)\nPrice: GET(coindeskApi, chartName, 2022-10-27T00:00Z)",
(err, file) => {
if (err) throw err;
console.log(String(file));
}
);
Chart name: Bitcoin
Price: API is no longer available
options.apis
(optional) - list of api referrences{ name: string; url: string }
.
If you are interested in contributing to this project, please open an issue with a description of what you would like to add.