How do I make an API request through Node.JS?

How do I make an API request through Node.JS?

In Zoho creator, I created a function that uses nodeJS. In the function, I'm making an API call to an outside URL using a fetch request. The problem is that whenever I run it, it says that "fetch" is not a function at module.exports. I've also tried it with an axios request but that doesn't work either. I see that there's a node_modules folder so I'm trying to put the axios module inside but it only allows me to upload files and not entire folders. How do I go about making an API call in NodeJS (in Zoho creator)?

  1. module.exports = async function (context, basicIO )
  2. {
  3. const baseURL = basicIO.getParameter("URL");
  4. axios(baseURL)
  5.     .then(resp => resp.json())
  6.     .then(data => 
  7.     basicIO.write(data)
  8.     );
  9. }