Redis Emulator Ready

The Redis emulator implements the full RESP (REdis Serialization Protocol) over TCP. It is wire-compatible with ioredis, redis (node-redis), and any other RESP client.

Connection

// ioredis
import Redis from 'ioredis';
const redis = new Redis('redis://127.0.0.1:6379');

// With password
const redis = new Redis('redis://:mypassword@127.0.0.1:6379');

// node-redis
import { createClient } from 'redis';
const client = createClient({ url: 'redis://127.0.0.1:6379' });
await client.connect();

Supported commands

CategoryCommands
StringsGET SET DEL EXISTS MGET MSET INCR DECR INCRBY DECRBY INCRBYFLOAT APPEND STRLEN GETSET SETNX SETEX PSETEX GETEX GETDEL SETRANGE GETRANGE
HashesHGET HSET HDEL HEXISTS HGETALL HKEYS HVALS HLEN HMGET HMSET HINCRBY HINCRBYFLOAT HSETNX
ListsLPUSH LPUSHX RPUSH RPUSHX LPOP RPOP LLEN LRANGE LINDEX LSET LINSERT LREM LTRIM
SetsSADD SREM SISMEMBER SMISMEMBER SMEMBERS SCARD SUNION SINTER SDIFF SUNIONSTORE SINTERSTORE SDIFFSTORE SRANDMEMBER SPOP SMOVE
Sorted SetsZADD ZREM ZSCORE ZCARD ZRANK ZREVRANK ZINCRBY ZRANGE ZREVRANGE ZRANGEBYSCORE ZREVRANGEBYSCORE ZCOUNT ZPOPMIN ZPOPMAX ZRANDMEMBER ZUNIONSTORE ZINTERSTORE
TTLEXPIRE PEXPIRE EXPIREAT PEXPIREAT TTL PTTL PERSIST
Pub/SubSUBSCRIBE UNSUBSCRIBE PUBLISH
ServerPING ECHO SELECT DBSIZE FLUSHDB FLUSHALL KEYS SCAN RANDOMKEY INFO OBJECT (ENCODING/REFCOUNT) TYPE RENAME RENAMENX WAIT

Persistence

Enable persistence in config to snapshot data to LevelDB every 5 seconds:

redis:
  persistence: true
  data_dir: ./.localdb/redis
Note: SELECT (multiple databases 0–15) is supported. The data browser shows keys for a selected DB index.

PostgreSQL Emulator Ready

Powered by pglite: a WebAssembly build of real PostgreSQL 16 embedded in Node.js. Clients connect via the standard PostgreSQL wire protocol; no special drivers needed.

Connection

// node-postgres (pg)
import { Pool } from 'pg';
const pool = new Pool({
  host: '127.0.0.1',
  port: 5432,
  database: 'myapp_dev',
  user: 'postgres',
});

// With connection string
const pool = new Pool({
  connectionString: 'postgresql://postgres@127.0.0.1:5432/myapp_dev'
});

// Prisma: datasource in schema.prisma
// datasource db {
//   provider = "postgresql"
//   url      = env("DATABASE_URL")
// }
// DATABASE_URL=postgresql://postgres@127.0.0.1:5432/myapp_dev

Multi-database support

Define multiple databases in config. Each database is a separate pglite instance:

postgres:
  enabled: true
  databases:
    - myapp_dev
    - myapp_test    # isolated DB for tests
    - analytics

Authentication

ConfigAuth methodConnection
password: ""Trust (no password)postgresql://postgres@127.0.0.1:5432/db
password: "secret"MD5postgresql://postgres:secret@127.0.0.1:5432/db

Supported features

  • ✓ DDL: CREATE/DROP TABLE, INDEX, SCHEMA, SEQUENCE
  • ✓ DML: SELECT, INSERT, UPDATE, DELETE with WHERE, JOIN, GROUP BY, ORDER BY
  • ✓ Transactions: BEGIN / COMMIT / ROLLBACK
  • ✓ Extended query protocol (prepared statements, parameterised queries)
  • ✓ Data types: JSONB, BOOLEAN, TIMESTAMPTZ, UUID, ARRAY, NUMERIC
  • ✓ Functions, aggregates, CTEs, window functions
pglite: ~95% of standard PostgreSQL SQL is supported. Complex features like logical replication, extensions (PostGIS, pgvector), and foreign data wrappers are not available.

MongoDB Emulator Ready

Powered by mongodb-memory-server, which downloads the official mongod binary for your platform on first run (~77 MB, cached in ~/.cache/mongodb-binaries). 100% wire-compatible: use the standard mongodb driver without modification.

First-run binary download: When MongoDB first starts, mongodb-memory-server downloads the official mongod binary for your OS (~77 MB). This happens once and is cached. Subsequent starts are instant (~100 ms). Set MONGOMS_DOWNLOAD_DIR to a shared path to reuse across projects.

Connecting

// Official mongodb driver (Node.js)
import { MongoClient } from 'mongodb';

const client = new MongoClient('mongodb://127.0.0.1:27017');
await client.connect();
const db = client.db('myapp_dev');

// Mongoose
await mongoose.connect('mongodb://127.0.0.1:27017/myapp_dev');

# .env
MONGODB_URI=mongodb://127.0.0.1:27017/myapp_dev

Configuration

mongodb:
  enabled: true
  port: 27017
  persistence: false        # true → WiredTiger engine, data survives restart
  data_dir: ./.localdb/mongodb  # required when persistence: true
  databases:
    - myapp_dev
    - myapp_test
FieldTypeDefaultDescription
enabledbooleantrueEnable / disable the emulator.
portnumber27017TCP port to bind on 127.0.0.1.
persistencebooleanfalseIf true, uses WiredTiger engine with data_dir for durable storage.
data_dirstringn/aDirectory for persistent data. Required when persistence: true.
databasesstring[]["test"]Logical database names exposed in the data browser. The wire protocol allows any database name regardless of this list.

Supported features

  • ✓ Full CRUD: insertOne/Many, findOne/find, updateOne/Many, deleteOne/Many, replaceOne
  • ✓ Aggregation pipeline ($match, $group, $sort, $project, $lookup, …)
  • ✓ Indexes: createIndex, unique indexes, compound indexes
  • ✓ Multi-database: data is fully isolated between databases
  • ✓ Persistence: WiredTiger storage engine, data survives restarts
  • ✓ Mongoose, Prisma, and any driver that targets the MongoDB wire protocol
Tip: The emulator is an unmodified mongod binary, so compatibility is effectively 100% for MongoDB 8.x features.