Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SlimDB<T>

Instance of SlimDB database.

Type parameters

  • T: object

Hierarchy

  • SlimDB

Index

Constructors

Properties

Methods

Constructors

constructor

  • new SlimDB(path: string): SlimDB
  • Create new SlimDB instance.

    Parameters

    • path: string

      Path to database.

    Returns SlimDB

Properties

Private data

data: T

path

path: string

Methods

delete

  • delete(): void
  • Delete the database file.

    Returns void

get

  • get(): T
  • Returns all data in the database.

    Returns T

load

  • load(): T

save

  • save(): void

update

  • update(callback: Function): void
  • Update data in the database.

    Parameters

    • callback: Function

      Callback that should modify data and return the result.

    Returns void

Generated using TypeDoc