new LokiFsAdapter()
A loki persistence adapter which persists using node fs module
Methods
deleteDatabase(dbname, callback)
deleteDatabase() - delete the database file, will throw an error if the file can't be deleted
Parameters:
Name | Type | Description |
---|---|---|
dbname |
string | the filename of the database to delete |
callback |
function | the callback to handle the result |
loadDatabase(dbname, callback)
loadDatabase() - Load data from file, will throw an error if the file does not exist
Parameters:
Name | Type | Description |
---|---|---|
dbname |
string | the filename of the database to load |
callback |
function | the callback to handle the result |
saveDatabase(dbname, callback)
saveDatabase() - save data to file, will throw an error if the file can't be saved might want to expand this to avoid dataloss on partial save
Parameters:
Name | Type | Description |
---|---|---|
dbname |
string | the filename of the database to load |
callback |
function | the callback to handle the result |