You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

fsfetch

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

fsfetch

Simple tool to make fast fetchs


Version published
Weekly downloads
34
increased by78.95%
Maintainers
0
Created
Weekly downloads
 

Readme

Source

⚡ FsFetch

npm version License: MIT Open Source Love

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.

Features

  • 🚀 Super Fast: Optimized for speed and performance.
  • ⚙️ Simple API: Easy to use, similar to Axios.
  • 🔒 Configurable: Custom headers, timeouts, and more.
  • 🌐 Supports All HTTP Methods: GET, POST, PUT, DELETE, PATCH.

Available Methods

  • get(url: string, config?: HTTPRequestConfig): Promise<HTTPResponse<T>>
  • post(url: string, data: any, config?: HTTPRequestConfig): Promise<HTTPResponse<T>>
  • put(url: string, data: any, config?: HTTPRequestConfig): Promise<HTTPResponse<T>>
  • delete(url: string, config?: HTTPRequestConfig): Promise<HTTPResponse<T>>
  • patch(url: string, data: any, config?: HTTPRequestConfig): Promise<HTTPResponse<T>>

Configuration Options

  • headers: Custom HTTP headers to send with the request.
  • timeout: Request timeout in milliseconds.

Example Usage

GET Request

Making a GET request:

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));

POST Request

Making a POST request with custom headers and timeout:

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));

FAQs

Package last updated on 03 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc