Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ez-api-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ez-api-wrapper - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

18

apiClient.js

@@ -66,9 +66,9 @@ const axios = require('axios');

try {
const response = await axios.get(`${apiUrl}/posts`);
return response.data;
const response = await axios.get(`${apiUrl}/posts`);
return response.data;
} catch (error) {
throw new Error(`Error fetching posts: ${error.message}`);
throw new Error(`Error fetching posts: ${error.message}`);
}
}
}
// Function to fetch users from the API

@@ -80,6 +80,3 @@ async function fetchUsers(apiUrl) {

const users = await axios.get(`${apiUrl}/users`);
return users.data;
// If an error occurs during the request, throw an error
} catch (error) {

@@ -89,2 +86,3 @@ throw new Error('Error fetching users: Network Error');

}
module.exports = {

@@ -95,3 +93,3 @@ fetchData,

fetchUsers,
};
emitter: emitter // Expose emitter for event handling
};
{
"name": "ez-api-wrapper",
"version": "1.0.3",
"version": "1.0.4",
"description": "Wrapper for an API: If there's an API you frequently use, you could create a wrapper for it that simplifies the process of making requests and handling responses. This could be for anything from weather data to social media APIs.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc