new db(path, optionsopt)
Create a JSON db manager
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
path |
string | Path to json file | ||
options |
dbOptions |
<optional> |
{debug: false} | Misc options |
Methods
(async) overwrite(valueopt)
Overwrites the contents with nothing or a passed value.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value |
ValidJson | string |
<optional> |
'' |
Returns:
Promise
(async) update(newData)
Updates the json db with new values.
Parameters:
| Name | Type | Description |
|---|---|---|
newData |
ValidJson | New/Changed data to be written/updated. |
Returns:
Promise