Class Writer

Prepares the output directories and controls the write process for the Mod files.

Writer

Constructors

  • Creates a new Writer.

    Parameters

    • directory: string = ...

      The target directory for the mod files. Defaults to "output".

    Returns Writer

    Memberof

    Writer

Properties

fancy: boolean
targetDirectory: any

Methods

  • Creates the output directory structure for the mod files, if it does not exist.

    It will delete existing directories and all files within.

    Returns Promise<void>

    Memberof

    Writer

  • Returns a valid file name from a given mod element id.

    Parameters

    • id: string

      The id to convert to a file name.

    Returns string

    The file name corresponding to the given id.

    Memberof

    Writer

  • Gets the full path to a nested directory within the target directory.

    For deeply nested directories, pass every directory as a separate argument in sequence.

    Parameters

    • Rest ...paths: string[]

      The path segments to join.

    Returns string

    The full path to the nested directory.

    Memberof

    Writer

  • Sets the target directory for the mod files.

    Parameters

    • directory: string

      The new target directory.

    Returns void

    Memberof

    Writer

  • Private

    Serializes a Writeable object and returns it as a JSON string.

    Parameters

    • object: Writeable

      A Writeable object to serialize.

    • prefix: string

      The prefix to use for the output file name.

    Returns string

    The serialized object as a JSON string.

  • Writes a Writeable object to the output directory.

    Parameters

    • object: Writeable

      The object to write.

    • prefix: string = "default"

      The prefix to use for the output file name.

    Returns Promise<void>

    Memberof

    Writer

Generated using TypeDoc