# @drizzle-http/undici

> Undici HTTP client for Drizzle-Http

Latest version **3.1.0** (published 2022-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @drizzle-http/undici
pnpm add @drizzle-http/undici
yarn add @drizzle-http/undici
bun add @drizzle-http/undici
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2022-01-03 |
| First published | 2021-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 2 |
| Unpacked size | 29.3 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Vitor Hugo Salgado |
| Maintainers | vitor.salgado |
| Keywords | drizzle-http, undici, http, api, decorators, rest |

## Links

- npm: https://www.npmjs.com/package/@drizzle-http/undici
- Repository: https://github.com/vitorsalgado/drizzle-http
- Homepage: https://github.com/vitorsalgado/drizzle-http/tree/main/drizzle-undici
- Issues: https://github.com/vitorsalgado/drizzle-http/issues
- npm.io page: https://npm.io/package/@drizzle-http/undici

## Dependencies (2)

- [undici](https://npm.io/package/undici.md) ^4.12.1
- [@drizzle-http/core](https://npm.io/package/@drizzle-http/core.md) ^3.1.0

## 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

- 3.1.0 (latest) — 2022-01-03
- 3.0.0 — 2022-01-02
- 2.2.0 — 2021-06-14
- 2.1.0 — 2021-03-20
- 2.0.0 — 2021-03-07
- 1.0.1 — 2021-03-03
- 1.0.0 — 2021-03-03
- 0.0.1-alpha.0 — 2021-03-01

## README

# Undici Client &middot; [![ci](https://github.com/vitorsalgado/drizzle-http/workflows/ci/badge.svg)](https://github.com/vitorsalgado/drizzle-http/actions) [![npm (scoped)](https://img.shields.io/npm/v/@drizzle-http/undici)](https://www.npmjs.com/package/@drizzle-http/undici) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vitorsalgado/drizzle-http/blob/main/LICENSE)

[Drizzle-Http](https://github.com/vitorsalgado/drizzle-http) client implementation using
[Undici](https://github.com/nodejs/undici).

## Installation

Make sure we have the core module [@Drizzle-Http/core](https://www.npmjs.com/package/@drizzle-http/core) installed.

```
npm i @drizzle-http/core
npm i @drizzle-http/undici
```

## Features

- Customize Undici pool
- Allows the response to be written direct to stream.

## Usage

### Basic setup

```typescript
import { UndiciCallFactory } from "@drizzle-http/undici";
import { DrizzleBuilder } from "@drizzle-http/core";

const api = DrizzleBuilder
  .newBuilder()
  .baseUrl(addr)
  .callFactory(new UndiciCallFactory())
  .build()
  .create(API)
```

## Stream

This feature uses [undici.stream](https://github.com/nodejs/undici#undicistreamurl-options-factory-promise) feature.  
Example:

```typescript
import { StreamingResponse } from "@drizzle-http/undici";
import { Streaming } from "@drizzle-http/undici";
import { StreamTo } from "@drizzle-http/undici";
import { GET } from "@drizzle-http/core";

class API {
  @GET('/')
  @Streaming()
  streaming(@StreamTo() target: Writable): Promise<StreamingResponse> { }
}
```

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