@alcalzone/jsonl-db
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -13,2 +13,3 @@ "use strict"; | ||
const fs = require("fs-extra"); | ||
const path = require("path"); | ||
const readline = require("readline"); | ||
@@ -90,2 +91,3 @@ const stream = require("stream"); | ||
// Open the file for appending and reading | ||
await fs.ensureDir(path.dirname(this.filename)); | ||
this._fd = await fs.open(this.filename, "a+"); | ||
@@ -92,0 +94,0 @@ const readStream = fs.createReadStream(this.filename, { |
{ | ||
"name": "@alcalzone/jsonl-db", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Simple JSONL-based key-value store", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -76,4 +76,4 @@ # jsonl-db | ||
|-----------------|---------|-------------| | ||
| intervalMs | 0 | Write to the database file no more than every `intervalMs` milliseconds. | | ||
| maxBufferedCommands | +Infinity | Force a write after `maxBufferedCommands` have been buffered. This reduces memory consumption and data loss in case of a crash. | | ||
| `intervalMs` | `0` | Write to the database file no more than every `intervalMs` milliseconds. | | ||
| `maxBufferedCommands` | `+Infinity` | Force a write after `maxBufferedCommands` have been buffered. This reduces memory consumption and data loss in case of a crash. | | ||
@@ -103,8 +103,8 @@ To create a compressed copy of the database in `/path/to/file.dump`, use the `dump()` method. If any data is written to the db during the dump, it is appended to the dump but most likely compressed. | ||
|-----------------|---------|-------------| | ||
| sizeFactor | +Infinity | Compress when `uncompressedSize >= size * sizeFactor` | | ||
| sizeFactorMinimumSize | 0 | Configure the minimum size necessary for auto-compression based on size | | ||
| intervalMs | +Infinity | Compress after a certain time has passed | | ||
| intervalMinChanges | 1 | Configure the minimum count of changes for auto-compression based on time | | ||
| onClose | false | Compress when closing the DB | | ||
| onOpen | false | Compress after opening the DB | | ||
| `sizeFactor` | `+Infinity` | Compress when `uncompressedSize >= size * sizeFactor` | | ||
| `sizeFactorMinimumSize` | 0 | Configure the minimum size necessary for auto-compression based on size | | ||
| `intervalMs` | `+Infinity` | Compress after a certain time has passed | | ||
| `intervalMinChanges` | 1 | Configure the minimum count of changes for auto-compression based on time | | ||
| `onClose` | `false` | Compress when closing the DB | | ||
| `onOpen` | `false` | Compress after opening the DB | | ||
@@ -135,2 +135,5 @@ ### Import / Export | ||
### 1.1.1 (2020-05-07) | ||
Leading directories are now created if they don't exist | ||
### 1.1.0 (2020-05-02) | ||
@@ -137,0 +140,0 @@ Added functionality to throttle write accesses |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50496
589
173