@drizzle-http/undici
    TypeScript icon, indicating that this package has built-in type declarations

    3.1.0 • Public • Published

    Undici Client · ci npm (scoped) GitHub license

    Drizzle-Http client implementation using Undici.

    Installation

    Make sure we have the core module @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

    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 feature.
    Example:

    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> { }
    }

    Install

    npm i @drizzle-http/undici

    DownloadsWeekly Downloads

    19

    Version

    3.1.0

    License

    MIT

    Unpacked Size

    30 kB

    Total Files

    37

    Last publish

    Collaborators

    • vitor.salgado