Start a single Redis server for testing or ephemeral data.
redis-server
must be available inPATH
. No cluster support.
Start a Redis server on port 6380:
const tmp = require('tmp-redis')
tmp(6380, function (err, shutdown) {
if (err) throw err
// When you're done
shutdown(function (err) {
if (err) throw err
})
})
Port must be a number. The callback
will receive an error if any, a shutdown
function that stops Redis, and a path
string to the configuration on disk (in a temporary directory). The optional options
object may contain the following properties:
verbose
: boolean, iftrue
, pipe Redis output to stderrpassword
: string, default none, require clients to connect with this passwordbufferLimit
: boolean, iffalse
, disableclient-output-buffer-limit
MIT © 2013-present Carlos Rodriguez, Terra Eclipse, Inc. and Contributors. Forked from haredis-tmp
.