Simple tool to make fast fetchs
npm install fsfetch


FastFetch is a super fast and optimized HTTP client for Node.js. It provides a simple and intuitive API to make HTTP requests with ease, inspired by the simplicity of Axios.
- get(url: string, config?: HTTPRequestConfig): Promise
- post(url: string, data: any, config?: HTTPRequestConfig): Promise
- put(url: string, data: any, config?: HTTPRequestConfig): Promise
- delete(url: string, config?: HTTPRequestConfig): Promise
- patch(url: string, data: any, config?: HTTPRequestConfig): Promise
- headers: Custom HTTP headers to send with the request.
- timeout: Request timeout in milliseconds.
Making a GET request:
``typescript
import FastFetch from 'fsfetch';
FastFetch.get('http://api.example.com/data')
.then(response => console.log('GET response:', response.data))
.catch(error => console.error('GET error:', error));
``
Making a POST request with custom headers and timeout:
``typescript
import FastFetch from 'fastfetch';
FastFetch.post('http://api.example.com/data', { key: 'value' }, {
headers: {
'Custom-Header': 'CustomValue',
'Authorization': 'Bearer your_token'
},
timeout: 5000 // 5 seconds
})
.then(response => console.log('POST response:', response.data))
.catch(error => console.error('POST error:', error));