@theophilusdev/conduit
    Preparing search index...

    Class ConduitAttachmentBuilder

    Builder for constructing attachment streams used in message uploads.

    Supports multiple input types:

    • File path → streamed via fs.createReadStream
    • URL → downloaded to temporary file then streamed
    • Buffer → converted via Readable.from
    • Readable → passed through directly

    URL-based inputs are temporarily written to disk and automatically deleted after streaming completes. This ensures memory efficiency but introduces asynchronous cleanup behavior.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    _data: Readable[]

    Methods

    • Saves all attachment streams to a directory or a single file path.

      Parameters

      • filepath: string

        Destination path. If multiple attachments are present, each file is saved as {filepath}.{index} to avoid collisions.

      Returns Promise<void>

      A promise that resolves when all attachments have been written.

      The destination directory is created recursively if it does not exist. Streams are written concurrently via Promise.all.