const axios = require('axios'); async function fetchData(url) { try { const response = await axios.get(url); // Make an API call console.log('Data fetched successfully:', response.data); // Handle success } catch (error) { console.error('Error fetching data:', error.message); // Handle error } }