Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "file"

Index

Variables

Const REPLAY_EXT

REPLAY_EXT: RegExp = /\.slp$/

Functions

getGamesFromDir

  • getGamesFromDir(startPath: string, recursive?: boolean): SlippiGame[]
  • Gather all the replays at the start path into an array

    Parameters

    • startPath: string

      Path to parent directory with .slp replay files and child replay directories

    • Default value recursive: boolean = false

      Whether the function will recursively walk through subdirectories

    Returns SlippiGame[]

withGamesFromDir

  • withGamesFromDir(startPath: string, callback: (game: SlippiGame) => void, recursive?: boolean): void
  • Walk through the filesystem from the start path and perform some function with any replay file ending with .slp.

    Parameters

    • startPath: string

      Path to parent directory with .slp replay files and child replay directories

    • callback: (game: SlippiGame) => void

      Callback function to be called with each SlippiGame game

        • (game: SlippiGame): void
        • Parameters

          • game: SlippiGame

          Returns void

    • Default value recursive: boolean = false

      Whether the function will recursively walk through subdirectories

    Returns void

withGamesFromDirAsync

  • withGamesFromDirAsync(startPath: string, callback: (game: SlippiGame) => void, recursive?: boolean): void
  • Walk through the filesystem from the start path and perform some function asynchronously with any replay file ending with .slp.

    Parameters

    • startPath: string

      Path to parent directory with .slp replay files and child replay directories

    • callback: (game: SlippiGame) => void

      Callback function to be called asynchronously with each SlippiGame game

        • (game: SlippiGame): void
        • Parameters

          • game: SlippiGame

          Returns void

    • Default value recursive: boolean = false

      Whether the function will recursively walk through subdirectories

    Returns void

Generated using TypeDoc