Gathering detailed insights and metrics for redis-memory-server
Gathering detailed insights and metrics for redis-memory-server
Gathering detailed insights and metrics for redis-memory-server
Gathering detailed insights and metrics for redis-memory-server
strapi-middleware-views
Views middleware to enable server-side rendering for the Strapi framework
koa-cash
HTTP response caching for Koa. HTTP response caching for Koa. Supports Redis, in-memory store, and more!
jest-redis
Jest preset for Redis in-memory server
redis-multi-server
This module was designed to mange multiple redis servers and do not let you think how information and on witch server is stored. Module will choose the server with more free information and memory
Redis Server for testing. The server will allow you to connect your favorite client library to the Redis Server and run parallel integration tests isolated from each other.
npm install redis-memory-server
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (90.38%)
JavaScript (9.62%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
95 Stars
612 Commits
15 Forks
2 Watchers
2 Branches
76 Contributors
Updated on Jul 08, 2025
Latest Version
0.12.1
Package Id
redis-memory-server@0.12.1
Unpacked Size
112.57 kB
Size
28.86 kB
File Count
42
NPM Version
10.9.0
Node Version
22.11.0
Published on
Jan 14, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
15
31
This package spins up a real Redis server programmatically from Node.js, for testing or mocking during development.
It holds the data in memory. Each redis-server
process takes about 4Mb of memory.
The server will allow you to connect your favorite client library to the Redis server and run integration tests isolated from each other.
It is inspired heavily by mongodb-memory-server.
On install, it downloads the Redis source,
compiles the redis-server
binary, and saves it to a cache folder.
On starting a new instance of the in-memory server, if the binary cannot be found, it will be downloaded and compiled; thus, the first run may take some time. All further runs will be fast because they will use the downloaded binaries.
This package automatically downloads source code from https://download.redis.io/.
Every RedisMemoryServer
instance starts a fresh Redis server on a free port.
You may start up several redis-server
processes simultaneously.
When you terminate your script or call stop()
, the Redis server(s) will be automatically shut down.
It works in Travis CI without additional services
or addons
in .travis.yml
.
1yarn add redis-memory-server --dev 2# OR 3npm install redis-memory-server --save-dev
On install, this package auto-downloads and compiles version stable
of the redis-server
binary to node_modules/.cache/redis-binaries
.
make
Although Windows is not officially supported by Redis, but there is a downloadable version of redis: 3.0.503 (June 28, 2016) for win64 by microsoft. This is an older version. It will work for most of the simple tasks like basic storage and pubsub. Probably what is missing or old is lua scripting.
Please note it will download the redis binary from github from URL: https://raw.githubusercontent.com/ServiceStack/redis-windows/master/downloads/redis-latest.zip
.
Optionally, you could provide your own URL before running npm install
:
npx cross-env REDISMS_DOWNLOAD_URL='https://raw.githubusercontent.com/ServiceStack/redis-windows/master/downloads/redis-latest.zip' npm install
redis-server
binary to useThe default behavior is that version stable
will be downloaded.
You can set configurations via environment variables
or via package.json
.
1import { RedisMemoryServer } from 'redis-memory-server'; 2 3const redisServer = new RedisMemoryServer(); 4 5const host = await redisServer.getHost(); 6const port = await redisServer.getPort(); 7 8// `redis-server` has been started 9// you may use `host` and `port` as connection parameters for `ioredis` (or similar) 10 11// you may check instance status 12redisServer.getInstanceInfo(); // returns an object with instance data 13 14// you may stop `redis-server` manually 15await redisServer.stop(); 16 17// when `redis-server` is killed, its running status should be `false` 18redisServer.getInstanceInfo(); 19 20// even if you forget to stop `redis-server`, 21// when your script exits, a special process killer will shut it down for you
1npx redis-memory-server 2# OR 3REDISMS_PORT=6379 npx redis-memory-server
All settings are optional.
1const redisServer = new RedisMemoryServer({
2 instance: {
3 port: number, // by default, choose any free port
4 ip: string, // by default, '127.0.0.1'; for binding to all IP addresses set it to `::,0.0.0.0`,
5 args: [], // by default, no additional arguments; any additional command line arguments for `redis-server`
6 },
7 binary: {
8 version: string, // by default, 'stable'
9 downloadDir: string, // by default, 'node_modules/.cache/redis-memory-server/redis-binaries'
10 systemBinary: string, // by default, undefined
11 },
12 autoStart: boolean, // by default, true
13});
1REDISMS_DOWNLOAD_DIR=/path/to/redis/binaries # default target download directory 2REDISMS_VERSION=6.0.10 # default version to download 3REDISMS_DEBUG=1 # debug mode, also available case-insensitive values: "on" "yes" "true" 4REDISMS_DOWNLOAD_MIRROR=host # your mirror host to download the redis binary 5REDISMS_DOWNLOAD_URL=url # full URL to download the redis binary 6REDISMS_DISABLE_POSTINSTALL=1 # if you want to skip download binaries on install 7REDISMS_SYSTEM_BINARY=/usr/local/bin/redis-server # if you want to use an existing binary already on your system.
package.json
You can also use package.json
to configure the installation process.
It will search up the hierarchy looking for package.json
files and combine all configurations, where closer package.json
files take precedence.
Environment variables have higher priority than contents of package.json
files.
1{ 2 "redisMemoryServer": { 3 "downloadDir": "/path/to/redis/binaries", 4 "version": "6.0.10", 5 "debug": "1", 6 "downloadMirror": "url", 7 "disablePostinstall": "1", 8 "systemBinary": "/usr/local/bin/redis-server" 9 } 10}
By default, it starts looking for package.json
files at process.cwd()
.
To change this:
1import { findPackageJson } from 'redis-memory-server/lib/util/resolve-config'; 2 3findPackageJson('/custom/path');
ioredis
Take a look at this test file.
Debug mode can be enabled with an environment variable or in package.json
:
1REDISMS_DEBUG=1 # also available case-insensitive values: "on", "yes", "true"
or
1{ 2 "redisMemoryServer": { 3 "debug": "1" 4 } 5}
This package is inspired heavily by mongodb-memory-server.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
6 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 2/15 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More