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
- Host: GitHub
- URL: https://github.com/binary-blazer/whizz
- Owner: binary-blazer
- License: gpl-3.0
- Created: 2024-09-13T16:40:01.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-14T21:39:07.000Z (8 months ago)
- Last Synced: 2024-10-31T18:56:48.396Z (7 months ago)
- Topics: fetcher, nodejs, sonicboom, webserver
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/whizz
- Size: 404 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: codeowners
Awesome Lists containing this project
README
## 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.