Node.js cURL Equivalent

You’ll need to install axios to run the equivalent cURL capabilities in Node.js. To do that run the following command

npm install --save axios

Lets convert the cURL command below to check public IP.

curl https://checkip.amazonaws.com

This will be the equivalent in axios

const axios = require('axios');
async function run(){
var options = {
method: 'GET',
url: 'https://checkip.amazonaws.com',
};
axios(options)
.then(function (response) {
// handle success…