Options
All
  • Public
  • Public/Protected
  • All
Menu

This class loads, saves and glitches data

Hierarchy

  • Processor

Index

Constructors

constructor

  • Returns Processor

Properties

Private JSONPath

JSONPath: string

Path to JSON file containing extracted feature data

Private glitchingFunction

glitchingFunction: any

Function that will be used to process feature data

Private tempDir

tempDir: string

Path of the temporary directory

Methods

glitch

  • glitch(file: File): Promise<void>
  • This function loads feature data, executes a provided glitching function and saves it all to disk.

    Parameters

    Returns Promise<void>

loadFeature

  • loadFeature(): Promise<unknown>
  • Parses feature data from JSON exported by ffedit. These JSON files tend to be quite large therefore we try to use some streaming JSON implementation insted of just require'ing it.

    Returns Promise<unknown>

loadGlitchingFunction

  • loadGlitchingFunction(path: string): void
  • Loads the glitching function module from disk

    Parameters

    • path: string

      Path to script file

    Returns void

saveFeatureToDisk

  • saveFeatureToDisk(feature: any): Promise<void>
  • Basically serializes a huge Object and saves it to disk.

    todo

    This is now the most time-consuming step (up to 2 minutes!), rewrite the whole glitching system that walks over JSON files, instead of loading them to memory.

    Parameters

    • feature: any

      A huge Object to be serialized

    Returns Promise<void>

Generated using TypeDoc