tmp-redis

1.0.0 • Public • Published

tmp-redis

Start a single Redis server for testing or ephemeral data.
redis-server must be available in PATH. No cluster support.

npm Node version Travis AppVeyor JavaScript Style Guide

Usage

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
  })
})

API

tmp(port[, options], callback)

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, if true, pipe Redis output to stderr
  • password: string, default none, require clients to connect with this password
  • bufferLimit: boolean, if false, disable client-output-buffer-limit

License

MIT © 2013-present Carlos Rodriguez, Terra Eclipse, Inc. and Contributors. Forked from haredis-tmp.

Readme

Keywords

Package Sidebar

Install

npm i tmp-redis

Weekly Downloads

5

Version

1.0.0

License

MIT

Unpacked Size

6.7 kB

Total Files

5

Last publish

Collaborators

  • vweevers