lite-axios-client
v1.0.2
Published
Lite-Axios_Client - For All Web Requests
Readme
lite-axios-client
A lightweight, zero-dependency HTTP client for Node.js — inspired by Axios, built for simplicity and speed.
🚀 Features
- Promise-based HTTP requests
- Supports
GET,POST,PUT, andDELETE - Automatically handles JSON payloads
- Based on Node.js native
http/httpsmodules - Zero external dependencies
📦 Installation
npm install lite-axios-client
📥 How to Import
In CommonJS (Node.js)
const axiosLite = require('lite-axios-client');
In ES Modules (with "type": "module" in package.json)
import axiosLite from 'lite-axios-client';
⚡ Quick Usage
const axiosLite = require('lite-axios-client');
axiosLite.get('https://jsonplaceholder.typicode.com/posts/1')
.then(res => {
console.log(res.status); // 200
console.log(res.data); // Parsed response JSON
})
.catch(err => console.error('Error:', err));
📘 API Reference
axiosLite.get('https://api.example.com/data', {
headers: { 'Authorization': 'Bearer token' }
});
➤ post(url, options)
axiosLite.post('https://api.example.com/users', {
data: { name: 'John Doe' },
headers: { 'Content-Type': 'application/json' }
});
➤ put(url, options)
➤ delete(url, options)
🔄 Response Format
{
status: 200,
headers: { ... },
data: { ... } // Parsed JSON or raw string
}
👤 Author
Made with ❤️ by Pradeep Sahani
Have feedback or want to contribute? PRs and issues are welcome!