Hierarchy

Constructors

Properties

name: string
path: string[]

Methods

  • Returns true if the file matches what is expected.

    Parameters

    • Optional chk: {
          sha1?: string | string[];
          size?: number;
      }
      • Optional sha1?: string | string[]
      • Optional size?: number

    Returns boolean

  • Sets the execution bit on a set file, used on Linux and Mac systems

    Returns void

  • Downloads a set file using fetch internally

    Parameters

    • url: string

      The url of the file you want to download

    • Optional chk: {
          sha1?: string | string[];
          size?: number;
      }

      The file check

      • Optional sha1?: string | string[]
      • Optional size?: number
    • Optional opt: {
          noRetry?: true;
          onReDownload?: ((file) => void);
          signal?: AbortSignal;
      }
      • Optional noRetry?: true
      • Optional onReDownload?: ((file) => void)
          • (file): void
          • Parameters

            Returns void

      • Optional signal?: AbortSignal

    Returns Promise<files.File>

    this object to allow for chaining

  • Creates a system link to a set file or directory using this file or folder as the the placeholder for the link (similar to linkTo)

    Parameters

    Returns void

  • Creates a system link to this file and puts the link at the destination file that was provided as input (similar to linkFrom)

    Parameters

    Returns void

  • Loads a json object from the file system and adds some shortcut functions to make it easier to save.

    Type Parameters

    • T

    Parameters

    • def: T
    • Optional serializer: ((raw) => T)
        • (raw): T
        • Parameters

          • raw: T

          Returns T

    Returns T & files.WrappedObj

  • Checks if an expected hash matches with this object. (@see getHash)

    Parameters

    • expected: string | string[]

    Returns boolean

  • Checks if the size value given matches with this object. (@see getSize)

    Parameters

    • expected: number

    Returns boolean

  • Reads a set file and returns a json representation of that object

    Type Parameters

    • T

    Returns T

  • Parameters

    • path: files.Dir
    • Optional opt: {
          exclude?: string[];
          include?: string[];
          zipDir?: files.Dir;
      }
      • Optional exclude?: string[]
      • Optional include?: string[]
      • Optional zipDir?: files.Dir

    Returns Promise<void>

  • Writes data to file. Automatically converts JSON objects to parsable strings before saving them

    Parameters

    • data: string | object | ArrayBuffer

    Returns void

Generated using TypeDoc