0.91.13 • Published 9 years ago

mock-redis-client v0.91.13

Weekly downloads
2,340
License
Apache 2.0
Repository
github
Last release
9 years ago

Mock Redis Client


A redis mock for node

NPM version Build Status Dependency Status

Introduction

The mock redis client borrows methods from node-redis-mock which was originally cloned from redis-mock. There are a few more implementations, like mset, mget, etc.

This project isn't a clone of mock-redis-client or mock-redis, rather it uses encapulation to inherit methods implemented by the base object. It's a cleaner way of extending the original works from both projects.

Installation

	npm install mock-redis-client --save-dev

Use

	var MockRedisClient = require('mock-redis-client');

    var client = new MockRedisClient();

Or if you need to mock redis itself, then do this:

    var redis = require('mock-redis-client').createMockRedis();

    var client = redis.createClient();

API

Currently implemented are the following:

General

  • createClient
  • end

Events

  • ready
  • connect
  • end
  • subscribe
  • unsubscribe
  • message

Publish/subscribe

  • publish
  • subscribe
  • unsubscribe

Keys

  • del
  • keys
  • exists
  • expire

Strings

  • get
  • set
  • incr
  • mset
  • mget

Hashing

  • hset
  • hsetnx
  • hget
  • hexists
  • hdel
  • hlen
  • hgetall
  • hmset
  • hkeys
  • hincrby

Lists

  • llen
  • lpush
  • rpush
  • lpushx
  • rpushx
  • lpop
  • rpop
  • blpop
  • brpop
  • lindex
  • lset
  • rpoplpush

Server

  • flushdb
  • flushall
  • save
  • lastsave
  • time
  • dbsize (always returns zero)
  • ping

Transactions

  • multi
  • exec
  • every previous supported commands can be chained

Tests

    make test

    or

    make watch

    or

    grunt mochaTest jshint validate-package

0.91.13

9 years ago

0.91.12

9 years ago

0.91.11

9 years ago

0.91.10

9 years ago

0.90.21

10 years ago

0.90.20

10 years ago

0.90.19

10 years ago

0.90.18

10 years ago

0.90.17

10 years ago

0.90.16

10 years ago

0.90.15

11 years ago

0.90.14

11 years ago

0.90.13

11 years ago

0.90.12

11 years ago

0.90.11

11 years ago

0.90.10

11 years ago