Redis driver for nitrous.js.
This is a plugin to nitrous.js. Make sure it is already installed as a dependency to your project.
To use this driver, run:
npm install --save @verdigris/nitrous-driver-redis ioredis@5
Then in your code, import the package:
const { Cache } = require("@verdigris/nitrous");
const Redis = require("@verdigris/nitrous-driver-redis");
const options = {
url: "redis://localhost:6379/0",
};
const cache = new Cache(new Redis(options));
import { Cache } from "@verdigris/nitrous";
import Redis from "@verdigris/nitrous-driver-redis";
const options = {
url: "redis://localhost:6379/0",
};
const cache = new Cache(new Redis(options));
The driver exposes the underlying Redis client through client
property:
const Redis = require("@verdigris/nitrous-driver-redis");
const redis = new Redis({ url: "redis://localhost:6379/0" });
// Call raw Redis LOLWUT command: https://redis.io/commands/lolwut
redis.client.lolwut((version) => console.log(version));
import Redis from "@verdigris-nitrous-driver-redis";
const redis = new Redis({ url: "redis://localhost:6379/0" });
// Call raw Redis LOLWUT command: https://redis.io/commands/lolwut
redis.client.lolwut((version) => console.log(version));
For more information on the Redis client, see: ioredis documentation.
Copyright © 2020-2024 Verdigris Technologies Inc. All rights reserved.