MicroDBBase
The api of the MicroDBBase class.
The MicroDBBase class is the heart of the micro-db package. It manages reading and writing to files.
Returns true when the db is initialized.
Type: readonly boolean
Returns the filename of the db-file.
Type: readonly string
Returns a reference to the active serializer.
Type: readonly MicroDBSerializer
Returns a reference to the active janitor instance (if a janitorCronjob got defined in the options).
Type: readonly MicroDBJanitor | undefined
Initialize the Database (read in existing data, setup the writeStream, etc.)
Returns: Promise<void>
Get the current dataset of the database.
Returns: Promise<MicroDBData>()
Write a single record into the db file.
Returns: Promise<void>
Write multiple records into the file at once.
Returns: Promise<void>
Free up memory space by ending the writeStream and removing all stored data from RAM. The Janitor will keep running.
Returns: Promise<void>
Ends the writeStream and kills the janitor (if existing).
Returns: Promise<void>