Registry / storage / dwaal

dwaal

JSON →
library0.2.0jsnpmunverified

Dwaal is a lightweight, local key-value store for Node.js that enables shared, persisted data across multiple processes on the same machine. It uses Unix sockets for inter-process communication and elects a leader process to manage an in-memory map, with lazy atomic writes (every ~500ms) to disk. Version 0.2.0 is the current stable release; it requires Node >=6.0.0 and is suitable for small-scale, local coordination tasks. Unlike Redis or SQLite, Dwaal is process-embedded and does not require a separate server.

storagedatabase
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Package does not support ES modules; use CommonJS require.

const Storage = require('dwaal');

Constructor expects an options object with a 'path' property, not a string.

const storage = new Storage({ path: '/path' });

All methods are asynchronous and return Promises.

storage.get('key').then(console.log);

set does not accept a callback; use the returned Promise.

storage.set('key', 'value').then(() => {});

Demonstrates creating a Storage instance, setting and getting a key, and closing the storage in Node.js.

const Storage = require('dwaal'); const storage = new Storage({ path: '/tmp/dwaal_test' }); storage.set('greeting', 'Hello, world!') .then(() => storage.get('greeting')) .then(value => { console.log('Retrieved:', value); // Clean up after demo storage.close(); }) .catch(err => console.error('Error:', err));
Debug
Known footguns
breakingDwaal requires a Unix-based system (Linux, macOS) because it uses Unix domain sockets. It will not work on Windows without additional compatibility layers.
deprecatedThe engine requirement 'node >=6.0.0' is outdated and may not work on newer Node versions due to internal API changes.
gotchaData storage is lazily written around every 500ms. If the process crashes or is killed before a write cycle, recent mutations may be lost.
gotchaThe 'path' must point to an existing directory. Dwaal does not create the directory automatically.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
18 hits · last 30 days
gptbot
3
amazonbot
3
bytedance
3
Resources
packagedwaal