Skip to content

fetchQuery v1.0.6

Latest

Choose a tag to compare

@DaimDN DaimDN released this 11 Jan 12:26
· 3 commits to main since this release

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.