An open API service indexing awesome lists of open source software.

https://github.com/binary-blazer/whizz

⚡ hyper fast nodejs webserver and fetcher
https://github.com/binary-blazer/whizz

fetcher nodejs sonicboom webserver

Last synced: 17 days ago
JSON representation

⚡ hyper fast nodejs webserver and fetcher

Awesome Lists containing this project

README

        





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















## Installation
To install Whizz:
```sh
npm install whizz
# or
yarn add whizz
# or
pnpm install whizz
```

## Usage
Here are some examples of how to use Whizz:

### GET Request
```js
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
```js
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`
Makes a GET request to the specified URL.

### `post(url: string, data: any, options?: RequestOptions): Promise`
Makes a POST request to the specified URL with the provided data.

### `put(url: string, data: any, options?: RequestOptions): Promise`
Makes a PUT request to the specified URL with the provided data.

### `delete(url: string, options?: RequestOptions): Promise`
Makes a DELETE request to the specified URL.

### `patch(url: string, options?: RequestOptions): Promise`
Makes a PATCH request to the specified URL.

### `head(url: string, options?: RequestOptions): Promise`
Makes a HEAD request to the specified URL.

### `options(url: string, options?: RequestOptions): Promise`
Makes an OPTIONS request to the specified URL.

### `trace(url: string, options?: RequestOptions): Promise`
Makes a TRACE request to the specified URL.

### `connect(url: string, options?: RequestOptions): Promise`
Makes a CONNECT request to the specified URL.

## Contributing
Contributions are welcome! Please read the [contributing guidelines](CONTRIBUTING.md) for more information.

## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.