Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "tools/file"

Index

Functions

Functions

read

  • read<T>(path: string, asJSON: true): Promise<T>
  • read(path: string): Promise<string>
  • Reads file.

    Type parameters

    • T

    Parameters

    • path: string

      the path to the file to read.

    • asJSON: true

      returns/reads as JSON object.

    Returns Promise<T>

  • Reads file.

    Parameters

    • path: string

      the path to the file to read.

    Returns Promise<string>

write

  • write(path: string, data: any, asJSON?: true): Promise<boolean>
  • write(path: string, data: any): Promise<boolean>
  • Writes a file to path.

    Parameters

    • path: string

      the path to the file to read.

    • data: any

      the data to be written.

    • Optional asJSON: true

      when true object is written as JSON.

    Returns Promise<boolean>

  • Writes a file to path.

    Parameters

    • path: string

      the path to the file to read.

    • data: any

      the data to be written.

    Returns Promise<boolean>

Generated using TypeDoc