# hytee

> Lightweight, 0 dependency HTTP client.

Latest version **0.0.2** (published 2022-01-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install hytee
pnpm add hytee
yarn add hytee
bun add hytee
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-01-25 |
| First published | 2022-01-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ádám Kovács |
| Maintainers | noopper |
| Keywords | HTTP, Client, Fetch API, Promise |

## Links

- npm: https://www.npmjs.com/package/hytee
- Repository: https://github.com/n00pper/hytee
- Homepage: https://github.com/n00pper/hytee#readme
- Issues: https://github.com/n00pper/hytee/issues
- npm.io page: https://npm.io/package/hytee

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2022-01-25
- 0.0.1 — 2022-01-23

## README

# Hytee

Hytee is a lightweight, 0 dependency HTTP client built on the native Fetch API.

## Features

- Simple GET, POST, PUT, DELETE requests
- Default configuration for every request
- Easy switching between temporary and default settings
- Case converting
- JWT token appending

## Installation

```
npm i hytee
```

## Usage

> This is a simple JavaScript example. The initialization might be run differently in a framework, but the sending of requests is pretty much the same.

```javascript
import Hytee from 'hytee';

// Create a function that will send the request
const login = () => {
	Hytee.put('/login', { email: 'email', password: 'password' })
		.then(res => {
			// successful request
		})
		.catch(err => {
			// unsuccessful request
		});
};

// Create a function that initializes the Hytee package
// This needs to be run only once per page load
const init = () => {
	Hytee.initialize({
		url: 'https://localhost:44300/api',
		parseResult: true,
		stringify: true,
		caseConvert: 'pascalToCamel',
		contentType: 'application/json',
	});

	// Send the request when the button is clicked
	const button = document.getElementById('login');
	button.onclick = login;
};

// Run the initializer function on page load
window.onload = init;
```

---
_Source: https://npm.io/package/hytee · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
