Class DB<T>

Type Parameters

  • T

Hierarchy

  • DB

Constructors

  • Constructor function

    Type Parameters

    • T

    Parameters

    • path: string

      path where file should be saved

    • Optional options: Config

      Options

    Returns DB<T>

Properties

data: Innerdata<T>[] = []
debugger?: default
opt: Config
path: string

Methods

  • delete a document with the specified id

    Parameters

    • id: string

      id to delete

    Returns DB<T>

  • get document from database with the given id

    Parameters

    • id: string

      id to fetch

    Returns Innerdata<T>

  • check if the db has a id

    Returns

    boolean indicating if id exists

    Parameters

    • id: string

      id to check

    Returns boolean

  • save file into the current file path

    Returns DB<T>

  • set a id to a given val in db

    Parameters

    • id: string

      id to save

    • val: T

      Document to save

    Returns DB<T>

  • stringify the db

    Returns string

Generated using TypeDoc