🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

whizz

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

whizz

Hyper fast nodejs webserver and fetcher

unpublished
latest
Source
npmnpm
Version
1.2.2
Version published
Maintainers
0
Created
Source

Whizz is a lightweight http client built on top of http for pure efficiency and speed

Installation

To install Whizz:

npm install whizz
# or
yarn add whizz
# or
pnpm install whizz

Usage

Here are some examples of how to use Whizz:

GET Request

import whizz from 'whizz';

async function fetchData() {
  const response = await whizz.get('https://jsonplaceholder.typicode.com/posts/1', { secure: true, timeout: 2000 });
  const data = response.json();
  console.log(data);

}

fetchData();

POST Request

import whizz from 'whizz';

async function postData() {
  const response = await whizz.post('https://jsonplaceholder.typicode.com/posts', {
    title: 'foo',
    body: 'bar',
    userId: 1,
  }, { secure: false }); 
  
  const data = response.json();
  console.log(data);
}

postData();

API Documentation

get(url: string, options?: RequestOptions): Promise<Response>

Makes a GET request to the specified URL.

post(url: string, data: any, options?: RequestOptions): Promise<Response>

Makes a POST request to the specified URL with the provided data.

put(url: string, data: any, options?: RequestOptions): Promise<Response>

Makes a PUT request to the specified URL with the provided data.

delete(url: string, options?: RequestOptions): Promise<Response>

Makes a DELETE request to the specified URL.

patch(url: string, options?: RequestOptions): Promise<Response>

Makes a PATCH request to the specified URL.

head(url: string, options?: RequestOptions): Promise<Response>

Makes a HEAD request to the specified URL.

options(url: string, options?: RequestOptions): Promise<Response>

Makes an OPTIONS request to the specified URL.

trace(url: string, options?: RequestOptions): Promise<Response>

Makes a TRACE request to the specified URL.

connect(url: string, options?: RequestOptions): Promise<Response>

Makes a CONNECT request to the specified URL.

Contributing

Contributions are welcome! Please read the contributing guidelines for more information.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

nodejs

FAQs

Package last updated on 14 Sep 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