curl2node
This is tool for converting curl bash command to Node.JS code.
Table of contents
Installation
yarn global add curl2node
Usage
curl2node generator curl https://google.com
If you would like to test if it will work first, feel free to use runner
instead of generator
.
curl2node runner curl https://google.com
Generated code will look something like this:
const got = require("got");
const options = {
"url": "https://google.com"
};
got(options).then((data) => {
console.log(data);
}).catch((error) => {
console.error(error);
});
Author