Registry / database / iorejson

iorejson

JSON →
library0.1.1jsnpmunverified

A Node.js client for the Redis ReJSON module, built on top of ioredis (version 0.1.1). It provides a simple asynchronous API to manage JSON documents stored in Redis, supporting commands like JSON.SET, JSON.GET, JSON.DEL, and more. The library wraps ioredis and inherits its connection options. Compared to other Redis JSON clients, iorejson is lightweight and conforms to ioredis conventions. However, it is a low-traffic, early-stage package (last updated 2017) and may not be actively maintained. It does not support JSON.DEBUG, JSON.FORGET, or JSON.RESP. The package name 'rejson' was taken on npm, so it is published as iorejson.

npm install iorejson
INSTALL
IMPORT
SIG · IOREJSON
I
iorejson
databasejavascriptv0.1.1
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.

Rejson
const Rejson = require('iorejson');
import Rejson from 'iorejson';
The package does not provide ES module exports; use CommonJS require.
default
const Rejson = require('iorejson'); const client = new Rejson();
import { Rejson } from 'iorejson';
The default export is the Rejson constructor; named import is incorrect.
Rejson instance methods
const client = new Rejson(); await client.set('key', '.', { foo: 'bar' });
Rejson.set(...) // Calling a static method that does not exist
Methods are instance methods, not static. Must instantiate first.

Demonstrates connecting, setting a JSON document, getting a nested value, deleting a path, and disconnecting.

const Rejson = require('iorejson'); async function main() { const client = new Rejson({ host: process.env.REDIS_HOST || 'localhost', port: process.env.REDIS_PORT || 6379, password: process.env.REDIS_PASSWORD || '' }); // Connect (optional, await ready) await client.connect(); // Set a JSON document await client.set('doc', '.', { name: 'John', age: 30, address: { city: 'NYC' } }); // Get a JSON path const name = await client.get('doc', '.name'); console.log('Name:', name); // 'John' // Delete a path await client.del('doc', '.address'); // Close connection client.disconnect(); } main().catch(console.error);
Debug
Known issues
gotchaThe package is not actively maintained; last release 2017. Might have compatibility issues with newer Redis or Node versions.
fix
Consider using an alternative like 'redis-json' directly or the official 'redis' client with JSON module support.
affects: >=0.1.1
breakingJSON.FORGET is not supported; use JSON.DEL instead.
fix
Replace calls to .forget() with .del().
affects: >=0.0.0
gotchaConnection is automatic by default; if you do not call connect(), the client will try to connect on first command but may not emit ready.
fix
Explicitly await client.connect() before issuing commands.
affects: >=0.0.0
deprecatedThe package is not compatible with ES modules; require() must be used.
fix
Use CommonJS require or dynamic import().
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: client.connect is not a function
Trying to call connect() on a Rejson instance without proper instantiation or using a wrong import.
fix
Ensure you do const client = new Rejson(); then await client.connect();
Error: ERR unknown command 'JSON.SET'
The Redis server does not have the ReJSON module loaded.
fix
Install the ReJSON module on your Redis server (e.g., using redis-stack or 'MODULE LOAD rejson.so').
TypeError: Rejson is not a constructor
Using ES module import syntax (import Rejson from 'iorejson') which is not supported.
fix
Use CommonJS: const Rejson = require('iorejson');
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
ioredisrequiredUnderlying Redis client used for all connections and commands.
Agent activity
6 hits · last 30 days
node
6
Resources
iorejson — npm install iorejson · libregistry