Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Document

A class representing a file of data.

Hierarchy

  • Document

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

loc: string

Accessors

  • get exists(): boolean
  • If the underlying file exists.

    Returns boolean

    True if the file exists.

  • get modified(): Date
  • The last modified time of the file.

    Returns Date

    The last modified time of the file, or new Date(0) if the file does not exist.

  • get size(): number
  • The size of the file in bytes.

    Returns number

    The size of the file in bytes, or 0 if the file does not exist.

Methods

  • delete(): void
  • get(): unknown
  • Get the data from the file.

    Returns unknown

    The contents of the file as a parsed object.

  • set(data: unknown, indent?: number): Document
  • Set the data in the file.

    Parameters

    • data: unknown

      The data to write to the file.

    • indent: number = 0

      The number of spaces to indent the JSON.

    Returns Document

    Document itself.

Generated using TypeDoc