1.1.0 • Published 6 months ago
jmk-api v1.1.0
JMK API
JMK API is a Node.js module for interacting with the JMK API in a simple and efficient way.
🔥 Features
- Seamless API requests with customizable methods.
- Automatically handles responses for:
- JSON data
- Binary files (images, etc.)
- Other content types.
- Lightweight and powered by Axios.
📦 Installation
Install the package via npm:
npm install jmk-api
🚀 Usage
Import and Initialize
const JmkApi = require('jmk-api');
const api = new JmkApi();
Fetch Available Routes
(async () => {
const routes = await api.route();
console.log(routes);
})();
Send a Custom API Request
(async () => {
const data = await api.run('example-route', {
method: 'POST',
key: 'value',
});
console.log(data);
})();
⚙️ Methods
run(route, payload)
- route: The API endpoint to call.
- payload: Object containing request configurations (e.g.,
method
,params
, ordata
).
route()
Fetches the list of available API routes.
🌟 License
This project is licensed under the MIT License.