Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FileAttachment

Stores file contents for use in the simulation. All file names must begin with attachment:/.

Hierarchy

  • FileAttachment

Index

Constructors

constructor

  • new FileAttachment(name: string, content: string | Buffer): FileAttachment
  • Create a new file stream.

    Parameters

    • name: string

      The name of the file.

    • content: string | Buffer

      The raw contents of the file. If the content is being constructed manually this can be a string (ex. weather stream constructed from external sources). If this is a file it is recommended that a Buffer be used.

    Returns FileAttachment

Properties

contents

contents: string | Buffer

The raw file contents.

filename

filename: string

The name of the file.

Static Private Readonly PARAM_ATTACHMENT

PARAM_ATTACHMENT: "file_attachment" = "file_attachment"

Static Private Readonly PARAM_ATTACHMENT_END

PARAM_ATTACHMENT_END: "file_attachment_end" = "file_attachment_end"

Methods

stream

  • stream(builder: Socket): void
  • Streams the attachment to a socket.

    Parameters

    • builder: Socket

    Returns void