web-csv-toolbox - v0.15.0
    Preparing search index...

    Class CSVRecordAssemblerTransformer<Header, Format>

    A transform stream that converts a stream of tokens into a stream of CSV records.

    For most use cases, prefer the factory function createCSVRecordAssemblerTransformer. Use this class directly only when you need a custom assembler implementation.

    A CSVRecordAssembler instance (required). Use createCSVRecordAssembler to create one.

    Stream-specific options (backpressureCheckInterval, etc.)

    Strategy for the writable side (default: { highWaterMark: 1024, size: () => 1 })

    Strategy for the readable side (default: { highWaterMark: 256, size: () => 1 })

    Choosing the Right API for guidance on selecting the appropriate API level.

    import { CSVRecordAssemblerTransformer, type CSVObjectRecordAssembler, type Token } from 'web-csv-toolbox';

    // Custom assembler for specialized record formats
    class MyCustomAssembler implements CSVObjectRecordAssembler<readonly string[]> {
    *assemble(
    input?: Token | Iterable<Token>,
    options?: { stream?: boolean }
    ): IterableIterator<Record<string, string>> {
    // Custom assembly logic
    }
    }

    const customAssembler = new MyCustomAssembler();
    tokenStream.pipeThrough(new CSVRecordAssemblerTransformer(customAssembler));

    Type Parameters

    • Header extends ReadonlyArray<string>

      The type of the header row.

    • Format extends "object" | "array" = "object"

      The output format ('object' or 'array').

    Hierarchy

    Index

    Constructors

    Properties

    readable: ReadableStream<CSVRecord<Header, Format, "keep">>

    The readable read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream.

    MDN Reference

    The writable read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream.

    MDN Reference

    Methods