Registry / storage / dwaal
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.

npm install dwaal
INSTALL
IMPORT
SIG · DWAAL
D
dwaal
storagejavascriptv0.2.0
harness data pending
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.

Storage
const Storage = require('dwaal');
import Storage from 'dwaal';
Package does not support ES modules; use CommonJS require.
Storage.options
const storage = new Storage({ path: '/path' });
new Storage('/path');
Constructor expects an options object with a 'path' property, not a string.
get
storage.get('key').then(console.log);
const value = storage.get('key');
All methods are asynchronous and return Promises.
set
storage.set('key', 'value').then(() => {});
storage.set('key', 'value', callback);
set does not accept a callback; use the returned Promise.

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 issues
breakingDwaal requires a Unix-based system (Linux, macOS) because it uses Unix domain sockets. It will not work on Windows without additional compatibility layers.
fix
Use WSL or a Linux environment on Windows.
affects: >=0.1.0
deprecatedThe engine requirement 'node >=6.0.0' is outdated and may not work on newer Node versions due to internal API changes.
fix
Check if the package works on your Node version; consider upgrading to an alternative if issues arise.
affects: 0.2.0
gotchaData storage is lazily written around every 500ms. If the process crashes or is killed before a write cycle, recent mutations may be lost.
fix
Be aware of the 500ms write window; use close() to ensure data is flushed before exiting.
affects: all
gotchaThe 'path' must point to an existing directory. Dwaal does not create the directory automatically.
fix
Ensure the directory exists before creating a Storage instance.
affects: all
Errors
Common errors & fixes
TypeError: Cannot read property 'get' of undefined
Constructor called without 'new' or with wrong arguments.
fix
Use 'new Storage({ path: '/dir' })' with an options object.
Error: connect ENOENT /tmp/dwaal.sock
The specified path directory does not exist or is not writable.
fix
Create the directory and ensure it is writable.
Error: listen EADDRINUSE :::0
Another Dwaal instance is already running on the same socket file.
fix
Close existing instances or use a different path.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
30
Amazon
1
OpenAI (training)
1
Resources
packagedwaal
dwaal — npm install dwaal · libregistry