Skip to content

Releases: DaimDN/fetchquery

fetchQuery v1.0.6

11 Jan 12:26

Choose a tag to compare

Release Notes

Version 1.0.6

🎉 Release

Features

  • HTTP Methods Support

    • GET, POST, PUT, PATCH, DELETE methods implemented
    • Full support for request headers and body data
    • Automatic handling of JSON parsing
  • Caching System

    • In-memory caching with customizable expiration time
    • Cache invalidation based on method, URL, and body
    • Skip cache option for fresh requests
    • Automatic cache cleanup
  • Response Handling

    • Comprehensive response objects including status, headers, and data
    • Support for compressed responses (gzip, deflate, brotli)
    • Error handling with detailed error messages
  • TypeScript Support

    • Full TypeScript definitions included
    • Generic type support for response data
    • Comprehensive interface definitions for all methods

Technical Details

  • Built for Node.js environments
  • Zero external dependencies
  • Supports both HTTP and HTTPS protocols
  • Automatic compression handling using zlib

Installation

npm install fetchquery

Basic Usage

const fetchQuery = require('fetchquery');

// GET request
const response = await fetchQuery.get('https://api.example.com/data');

// POST request with data
const postResponse = await fetchQuery.post('https://api.example.com/create', {
  name: 'John Doe'
});

TypeScript Usage

import fetchQuery from 'fetchquery';

interface UserData {
  id: number;
  name: string;
}

const response = await fetchQuery.get<UserData>('https://api.example.com/user/1');
console.log(response.data.name); // TypeScript aware!

Configuration

// Set cache expiration time (in milliseconds)
fetchQuery.setCacheExpirationTime(30 * 60 * 1000); // 30 minutes

// Skip cache for specific requests
const freshData = await fetchQuery.get('https://api.example.com/data', {}, true);

Breaking Changes

  • None (Initial Release)

Known Issues

  • None reported

Upcoming Features

  • Request interceptors
  • Response interceptors
  • Request cancellation
  • Rate limiting
  • Retry mechanism
  • Queue management

For more details, please refer to the documentation.

Contributing

We welcome contributions! Please see our contributing guidelines for details.

License

MIT License - see the LICENSE file for details.


🔍 For any bugs or feature requests, please create an issue.

fetchQuery v1.0.0

11 Jan 00:15

Choose a tag to compare

Release Notes - fetchQuery v1.0.0

🚀 New Features

1. Unified HTTP Request API

  • Simplified methods for GET, POST, PUT, PATCH, and DELETE HTTP requests.
  • Inspired by popular HTTP clients with an intuitive and familiar API.

2. Built-in Caching Mechanism

  • Automatic caching for GET requests to reduce redundant API calls.
  • Configurable cache expiration time (default: 1 hour).
  • Optional cache bypass with the skipCache parameter.

3. Cross-Platform Support (Browser & Node.js)

  • Uses native XMLHttpRequest in the browser.
  • Utilizes Node's built-in http and https modules for server-side compatibility.

4. Custom Headers & Request Bodies

  • Flexible support for custom headers and request bodies across all HTTP methods.

5. Minimal Dependencies

  • Designed to keep projects lightweight by avoiding unnecessary dependencies.

6. Asynchronous Operations with Promises

  • Fully supports async/await for modern, non-blocking code execution.

🛠️ Improvements

  • Optimized request handling to ensure consistent performance.
  • Enhanced error handling for network and data parsing errors.

🔧 Configuration Options

  • Cache Expiration Time: Customize using fetchQuery.setCacheExpirationTime(timeInMs).
  • Bypass Cache: Force fresh data with skipCache: true.

📦 Installation

npm install fetch-query

📚 Documentation

Refer to the [README](README.md) for detailed setup instructions and usage examples.

🙌 Contribution

We welcome contributions! Check the contributing guidelines in the repository.

📄 License

This project is licensed under the MIT License.


fetchQuery v1.0.0 - Making HTTP Requests Simple and Efficient!