@adviser/cement - v0.0.0
    Preparing search index...

    Function string2stream

    • Converts a string to a ReadableStream of Uint8Array chunks.

      Encodes the string as UTF-8 and creates a stream with a single chunk. Useful for creating request bodies or piping string data through streams.

      Parameters

      • str: string

        The string to convert to a stream

      • ende: TxtEnDecoder = ...

        Optional TextEncoder (uses singleton if not provided)

      Returns ReadableStream<Uint8Array<ArrayBufferLike>>

      ReadableStream containing the encoded string

      const stream = string2stream('Hello, World!');
      await stream.pipeTo(writable);