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
| Category | Commands |
|---|---|
| Strings | GET SET DEL EXISTS MGET MSET INCR DECR INCRBY DECRBY INCRBYFLOAT APPEND STRLEN GETSET SETNX SETEX PSETEX GETEX GETDEL SETRANGE GETRANGE |
| Hashes | HGET HSET HDEL HEXISTS HGETALL HKEYS HVALS HLEN HMGET HMSET HINCRBY HINCRBYFLOAT HSETNX |
| Lists | LPUSH LPUSHX RPUSH RPUSHX LPOP RPOP LLEN LRANGE LINDEX LSET LINSERT LREM LTRIM |
| Sets | SADD SREM SISMEMBER SMISMEMBER SMEMBERS SCARD SUNION SINTER SDIFF SUNIONSTORE SINTERSTORE SDIFFSTORE SRANDMEMBER SPOP SMOVE |
| Sorted Sets | ZADD ZREM ZSCORE ZCARD ZRANK ZREVRANK ZINCRBY ZRANGE ZREVRANGE ZRANGEBYSCORE ZREVRANGEBYSCORE ZCOUNT ZPOPMIN ZPOPMAX ZRANDMEMBER ZUNIONSTORE ZINTERSTORE |
| TTL | EXPIRE PEXPIRE EXPIREAT PEXPIREAT TTL PTTL PERSIST |
| Pub/Sub | SUBSCRIBE UNSUBSCRIBE PUBLISH |
| Server | PING 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
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
| Config | Auth method | Connection |
|---|---|---|
password: "" | Trust (no password) | postgresql://postgres@127.0.0.1:5432/db |
password: "secret" | MD5 | postgresql://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
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.
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
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable / disable the emulator. |
port | number | 27017 | TCP port to bind on 127.0.0.1. |
persistence | boolean | false | If true, uses WiredTiger engine with data_dir for durable storage. |
data_dir | string | n/a | Directory for persistent data. Required when persistence: true. |
databases | string[] | ["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
mongod binary, so compatibility is effectively 100% for MongoDB 8.x features.