Registry / database / resplite

resplite

JSON →
library1.5.6jsnpmunverified

RESPLite v1.5.6 is a RESP2 protocol server (compatible with redis clients and redis-cli) backed by SQLite for persistent storage. It provides practical Redis-compatible commands (strings, hashes, sorted sets, lists, full-text search via FTS5) with zero external daemons and minimal memory footprint. Persistence is built-in via WAL-mode SQLite – no AOF, no RDB, no config. Key differentiators: outperforms Redis-in-Docker for single-node workloads (latency benchmarks show 2-4x improvement), supports migration from large Redis instances (tens of GB) without replication, and is embeddable in Node.js scripts. Active development with regular releases.

npm install resplite
INSTALL
IMPORT
SIG · RESPLITE
R
resplite
databasejavascriptv1.5.6
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.

createRESPlite
import { createRESPlite } from 'resplite'
const { createRESPlite } = require('resplite')
ESM-only since v1. CJS require will not work.
RESPliteOptions
import type { RESPliteOptions } from 'resplite'
import { RESPliteOptions } from 'resplite' (not a runtime value)
This is a TypeScript type export, not a runtime symbol. Use `import type` to avoid bundler issues.
default
import RESPlite from 'resplite'
No default export exists; use named import { createRESPlite }
The package does not export a default. Always use the named export.

Shows embedding RESPLite in Node.js, connecting with redis client, basic SET/GET, and full-text search via FT.SEARCH.

import { createRESPlite } from 'resplite'; import { createClient } from 'redis'; async function main() { const srv = await createRESPlite({ port: 6380, db: './data.db', }); const client = createClient({ url: 'redis://localhost:6380' }); await client.connect(); await client.set('foo', 'bar'); const value = await client.get('foo'); console.log(value); // 'bar' // Full-text search via FTS5 await client.sendCommand(['FT.CREATE', 'idx', 'ON', 'HASH', 'PREFIX', '1', 'doc:', 'SCHEMA', 'title', 'TEXT', 'body', 'TEXT']); await client.hSet('doc:1', { title: 'hello', body: 'world' }); const results = await client.sendCommand(['FT.SEARCH', 'idx', 'hello']); console.log(results); // array of matching documents await client.disconnect(); srv.close(); } main().catch(console.error);
Debug
Known issues
breakingOnly RESP2 protocol supported; RESP3 (Redis 6+) features like push types (HELLO 3) will fail.
fix
Ensure your redis client uses RESP2 mode (default with redis npm package < v4, or set { protocol: 2 } in newer clients).
affects: >=1.0.0
breakingTransaction (MULTI/EXEC) is guaranteed atomic but does NOT support WATCH. Concurrent writes may cause lost updates.
fix
Do not rely on WATCH for optimistic locking. Use application-level locks or SQLite WAL conflicts.
affects: >=1.0.0
gotchaKey expiration (TTL/PEXPIRE) precision is limited to second granularity. Sub-second timeouts may drift.
fix
Use integer seconds for TTL; do not rely on millisecond precision for expiry.
affects: >=1.0.0
deprecatedThe `KEYS` command is renamed by default to `SAFE_KEYS` (original blocked). Use `SAFE_KEYS` or reconfigure in commandPolicy.
fix
Use `SAFE_KEYS` instead of `KEYS`, or override commandPolicy.rename to allow KEYS explicitly.
affects: >=1.0.0
gotchaFull-text search (FT.*) requires SQLite FTS5. The SQLite build must have FTS5 enabled (common in better-sqlite3 default).
fix
Check `better-sqlite3` is compiled with FTS5 support (npm package includes it). On some Linux distros, rebuild from source may be needed.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'better-sqlite3'
Missing better-sqlite3 native dependency.
fix
Run `npm install better-sqlite3` explicitly if not automatically installed.
ERR unknown command 'KEYS'
CommandPolicy renames KEYS to SAFE_KEYS by default.
fix
Use `SAFE_KEYS` instead of `KEYS`, or pass `{ commandPolicy: { rename: {} } }` to createRESPlite to disable renaming.
ERR Protocol error: invalid bulk length
Client sent RESP3 HELLO command, which is not supported (RESP2 only).
fix
Configure redis client to use RESP2: `createClient({ socket: { reconnectStrategy: false }, protocol: 2 })`.
Upgrade
Version history
1.5.6latest on npm
Audit
Dependencies
better-sqlite3requiredSQLite bindings for Node.js
Agent activity
7 hits · last 30 days
node
6
Meta
1
Resources
resplite — npm install resplite · libregistry