@ -309,6 +309,10 @@ automatically considered in-memory only. It cannot end with a <code>~</code> whi
perform crash-safe writes. Not used if <code>options.inMemoryOnly</code> is <code>true</code>.</p>
perform crash-safe writes. Not used if <code>options.inMemoryOnly</code> is <code>true</code>.</p>
- [.inMemoryOnly] <code>boolean</code><code> = false</code> - <p>If set to true, no data will be written in storage. This option has
- [.inMemoryOnly] <code>boolean</code><code> = false</code> - <p>If set to true, no data will be written in storage. This option has
priority over <code>options.filename</code>.</p>
priority over <code>options.filename</code>.</p>
- [.mode] <code>object</code> - <p>Permissions to use for FS. Only used for
Node.js storage module.</p>
- [.fileMode] <code>number</code><code> = 0o644</code> - <p>Permissions to use for database files</p>
- [.dirMode] <code>number</code><code> = 0o755</code> - <p>Permissions to use for database directories</p>
- [.timestampData] <code>boolean</code><code> = false</code> - <p>If set to true, createdAt and updatedAt will be created and
- [.timestampData] <code>boolean</code><code> = false</code> - <p>If set to true, createdAt and updatedAt will be created and
populated automatically (if not specified by user)</p>
populated automatically (if not specified by user)</p>
- [.autoload] <code>boolean</code><code> = false</code> - <p>If used, the database will automatically be loaded from the datafile
- [.autoload] <code>boolean</code><code> = false</code> - <p>If used, the database will automatically be loaded from the datafile
@ -834,6 +838,9 @@ with <code>appendfsync</code> option set to <code>no</code>.</p>
- [.corruptAlertThreshold] <code>Number</code> - <p>Optional, threshold after which an alert is thrown if too much data is corrupt</p>
- [.corruptAlertThreshold] <code>Number</code> - <p>Optional, threshold after which an alert is thrown if too much data is corrupt</p>
- [.beforeDeserialization] [<code>serializationHook</code>](#serializationHook) - <p>Hook you can use to transform data after it was serialized and before it is written to disk.</p>
- [.beforeDeserialization] [<code>serializationHook</code>](#serializationHook) - <p>Hook you can use to transform data after it was serialized and before it is written to disk.</p>
- [.afterSerialization] [<code>serializationHook</code>](#serializationHook) - <p>Inverse of <code>afterSerialization</code>.</p>
- [.afterSerialization] [<code>serializationHook</code>](#serializationHook) - <p>Inverse of <code>afterSerialization</code>.</p>
- [.mode] <code>object</code> - <p>Modes to use for FS permissions.</p>
- [.fileMode] <code>number</code><code> = 0o644</code> - <p>Mode to use for files.</p>
- [.dirMode] <code>number</code><code> = 0o755</code> - <p>Mode to use for directories.</p>
<aname="Persistence+compactDatafile"></a>
<aname="Persistence+compactDatafile"></a>
@ -934,7 +941,7 @@ with <code>appendfsync</code> option set to <code>no</code>.</p>
@ -13,6 +13,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- An auto-generated JSDoc file is generated: [API.md](./API.md).
- An auto-generated JSDoc file is generated: [API.md](./API.md).
- Added `Datastore#dropDatabaseAsync` and its callback equivalent.
- Added `Datastore#dropDatabaseAsync` and its callback equivalent.
- The Error given when the `Datastore#corruptAlertThreshold` is reached now has three properties: `dataLength` which is the amount of lines in the database file (excluding empty lines), `corruptItems` which is the amount of corrupted lines, `corruptionRate` which the rate of corruption between 0 and 1.
- The Error given when the `Datastore#corruptAlertThreshold` is reached now has three properties: `dataLength` which is the amount of lines in the database file (excluding empty lines), `corruptItems` which is the amount of corrupted lines, `corruptionRate` which the rate of corruption between 0 and 1.
- Added a `mode` option which allows to set the file and / or directory modes, by default, it uses `0o644` for files and `0o755` for directories, which may be breaking.
### Changed
### Changed
- The `corruptionAlertThreshold` now doesn't take into account empty lines, and the error message is slightly changed.
- The `corruptionAlertThreshold` now doesn't take into account empty lines, and the error message is slightly changed.