From b8825404bc91625bb167c9b01b91c0eb88eab454 Mon Sep 17 00:00:00 2001
From: 付智勇 <fuzhiyong@efangtec.com>
Date: Mon, 28 Aug 2017 10:41:13 +0800
Subject: [PATCH] no message

---
 controller/userController.js                        |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++----------
 docs/api.md                                         |   17 ++++++++++++-----
 dump.rdb                                            | Bin 0 -> 109 bytes
 model/studentMeetingModel.js                        |   24 ++++++++++++++++++++++++
 model/userModel.js                                  |    5 +++++
 node_modules/double-ended-queue/.npmignore          |   31 +++++++++++++++++++++++++++++++
 node_modules/double-ended-queue/Gruntfile.js        |  188 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/double-ended-queue/LICENSE             |   19 +++++++++++++++++++
 node_modules/double-ended-queue/README.md           |  293 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/double-ended-queue/js/deque.js         |  275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/double-ended-queue/package.json        |  101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-commands/.npmignore              |   29 +++++++++++++++++++++++++++++
 node_modules/redis-commands/.travis.yml             |    9 +++++++++
 node_modules/redis-commands/LICENSE                 |   22 ++++++++++++++++++++++
 node_modules/redis-commands/README.md               |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-commands/changelog.md            |   32 ++++++++++++++++++++++++++++++++
 node_modules/redis-commands/commands.json           | 1796 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-commands/index.js                |  155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-commands/package.json            |  110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-commands/test/index.js           |  120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-commands/tools/build.js          |   62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-parser/.npmignore                |   15 +++++++++++++++
 node_modules/redis-parser/LICENSE                   |   22 ++++++++++++++++++++++
 node_modules/redis-parser/README.md                 |  163 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-parser/changelog.md              |  138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-parser/index.js                  |    6 ++++++
 node_modules/redis-parser/lib/hiredis.js            |   62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-parser/lib/parser.js             |  581 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis-parser/lib/parserError.js        |   25 +++++++++++++++++++++++++
 node_modules/redis-parser/lib/redisError.js         |   24 ++++++++++++++++++++++++
 node_modules/redis-parser/lib/replyError.js         |   23 +++++++++++++++++++++++
 node_modules/redis-parser/package.json              |  114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/.eslintignore                    |    4 ++++
 node_modules/redis/.eslintrc                        |  108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/.github/ISSUE_TEMPLATE.md        |   15 +++++++++++++++
 node_modules/redis/.github/PULL_REQUEST_TEMPLATE.md |   14 ++++++++++++++
 node_modules/redis/.npmignore                       |   10 ++++++++++
 node_modules/redis/LICENSE                          |   24 ++++++++++++++++++++++++
 node_modules/redis/README.md                        |  965 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/changelog.md                     |  845 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/index.js                         | 1105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/lib/command.js                   |   16 ++++++++++++++++
 node_modules/redis/lib/commands.js                  |  121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/lib/createClient.js              |   80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/lib/customErrors.js              |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/lib/debug.js                     |   11 +++++++++++
 node_modules/redis/lib/extendedApi.js               |  113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/lib/individualCommands.js        |  617 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/lib/multi.js                     |  187 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/lib/utils.js                     |  134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 node_modules/redis/package.json                     |  135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 routes/users.js                                     |   45 +++++++++++++++++++++++++++++++++++++++++++++
 services/userService.js                             |   34 +++++++++++++++++++++++++++++++---
 util/SendSms.js                                     |    0
 util/redis.js                                       |   25 +++++++++++++++++++++++++
 55 files changed, 9221 insertions(+), 18 deletions(-)
 create mode 100644 dump.rdb
 create mode 100644 model/studentMeetingModel.js
 create mode 100644 node_modules/double-ended-queue/.npmignore
 create mode 100644 node_modules/double-ended-queue/Gruntfile.js
 create mode 100644 node_modules/double-ended-queue/LICENSE
 create mode 100644 node_modules/double-ended-queue/README.md
 create mode 100644 node_modules/double-ended-queue/js/deque.js
 create mode 100644 node_modules/double-ended-queue/package.json
 create mode 100644 node_modules/redis-commands/.npmignore
 create mode 100644 node_modules/redis-commands/.travis.yml
 create mode 100644 node_modules/redis-commands/LICENSE
 create mode 100644 node_modules/redis-commands/README.md
 create mode 100644 node_modules/redis-commands/changelog.md
 create mode 100644 node_modules/redis-commands/commands.json
 create mode 100644 node_modules/redis-commands/index.js
 create mode 100644 node_modules/redis-commands/package.json
 create mode 100644 node_modules/redis-commands/test/index.js
 create mode 100644 node_modules/redis-commands/tools/build.js
 create mode 100644 node_modules/redis-parser/.npmignore
 create mode 100644 node_modules/redis-parser/LICENSE
 create mode 100644 node_modules/redis-parser/README.md
 create mode 100644 node_modules/redis-parser/changelog.md
 create mode 100644 node_modules/redis-parser/index.js
 create mode 100644 node_modules/redis-parser/lib/hiredis.js
 create mode 100644 node_modules/redis-parser/lib/parser.js
 create mode 100644 node_modules/redis-parser/lib/parserError.js
 create mode 100644 node_modules/redis-parser/lib/redisError.js
 create mode 100644 node_modules/redis-parser/lib/replyError.js
 create mode 100644 node_modules/redis-parser/package.json
 create mode 100644 node_modules/redis/.eslintignore
 create mode 100644 node_modules/redis/.eslintrc
 create mode 100644 node_modules/redis/.github/ISSUE_TEMPLATE.md
 create mode 100644 node_modules/redis/.github/PULL_REQUEST_TEMPLATE.md
 create mode 100644 node_modules/redis/.npmignore
 create mode 100644 node_modules/redis/LICENSE
 create mode 100644 node_modules/redis/README.md
 create mode 100644 node_modules/redis/changelog.md
 create mode 100644 node_modules/redis/index.js
 create mode 100644 node_modules/redis/lib/command.js
 create mode 100644 node_modules/redis/lib/commands.js
 create mode 100644 node_modules/redis/lib/createClient.js
 create mode 100644 node_modules/redis/lib/customErrors.js
 create mode 100644 node_modules/redis/lib/debug.js
 create mode 100644 node_modules/redis/lib/extendedApi.js
 create mode 100644 node_modules/redis/lib/individualCommands.js
 create mode 100644 node_modules/redis/lib/multi.js
 create mode 100644 node_modules/redis/lib/utils.js
 create mode 100644 node_modules/redis/package.json
 create mode 100644 util/SendSms.js
 create mode 100644 util/redis.js

diff --git a/controller/userController.js b/controller/userController.js
index 83949d3..d0c1061 100644
--- a/controller/userController.js
+++ b/controller/userController.js
@@ -3,6 +3,8 @@ var saitMd5 = require('../util/saltMD5')
 var status = require('../util/resTemplate') 
 const userService = require('../services/userService')
 const uuid = require('../util/UuidUtil')
+const redis = require('../util/redis')
+
 
 
 var userController =function (){
@@ -19,14 +21,30 @@ var userController =function (){
 userController.prototype.addUser = async(ctx, next) =>{
     try{
     var params = ctx.request.body;
-    const pw = saitMd5.md5AddSalt(params.password)    
+    var  pw = saitMd5.md5AddSalt(params.password)    
 
     if(!params.loginName){
         return status.paramError('loginName');
-    }else if(!params.password){
-        return status.paramError('password','不能为空');        
-    }else if(params.password.length < 6){
-        return status.paramError('password','不得小于6位');                
+    }else  if(!params.userEmail){
+        return status.paramError('userEmail');
+    }
+
+    if(params.userRole == 2 || params.userRole == 3){
+         if(!params.IDcard){
+            return status.paramError('IDcard','不能为空');        
+        }else if(!params.userName){
+            return status.paramError('userName','不能为空');                
+        }
+        pw = saitMd5.md5AddSalt('123456')
+        params.loginName = Math.random().toString(24).substr(9);        
+    }else if(params.userRole == 4){
+        if(!params.userMobile){
+            return status.paramError('userMobile','不能为空');        
+        }else if(!params.password){
+            return status.paramError('password','不能为空');        
+        }else if(params.password.length < 6){
+            return status.paramError('password','不得小于6位');                
+        }
     }
 
     var user = {
@@ -34,6 +52,7 @@ userController.prototype.addUser = async(ctx, next) =>{
         password:pw.md5Pass,
         companyName:params.companyName,
         userName:params.userName,
+        IDcard:params.IDcard,
         salt:pw.salt,
         userType:params.userType,
         userRole:params.userRole,
@@ -54,16 +73,19 @@ userController.prototype.addUser = async(ctx, next) =>{
  * 用户登录
  */
 userController.prototype.login = async(ctx, next) =>{
+    try{
     const body = ctx.request.body;
-    
-    if(!body.name){
-        return status.paramError('name');        
+    await redis.setToken('qwe123','qwe123');
+    let redisCode = await redis.getToken('qwe123')
+    console.log(redisCode)
+    if(redisCode != body.code ){
+    }else if(!body.loginName&&!body.userEmail){
+        return status.paramError('userEmail loginName');        
     }else if(!body.password){
         return status.paramError('password');
     }
 
-    try{
-        let userData =  await userService.login(body.name ,body.password);
+        let userData =  await userService.login(body.loginName ,body.password,body.userEmail);
         var userBack = {
             id:userData.id,
             loginName:userData.loginName,
@@ -97,6 +119,7 @@ userController.prototype.getStu = async(ctx, next) =>{
         throw new Error(error)
     }
 }
+
 userController.prototype.updateUserByUserId = async(ctx, next) =>{
     const userId =  ctx.params.userId;
     const updateData = ctx.request.body;
@@ -147,4 +170,21 @@ userController.prototype.resetPasswordByUserId = async(ctx,next) =>{
     }
 }
 
+userController.prototype.updatePwByTelphone = async(ctx, next) =>{
+    const code  = ctx.request.body.code;
+    const telephone  = ctx.request.body.telephone; 
+    const password = ctx.request.body.password;
+    const pw = saitMd5.md5AddSalt(password);    
+    
+    let setCode = await redis.setToken(code,code)  
+    let redisCode = await redis.getToken(code);
+    if(code != redisCode){
+        return {code:500,msg:'验证码错误'};                
+    }else if(!password){
+        return {code:501,msg:'密码不能为空'};                        
+    }
+    let updatePW = await userService.updatePwByTelphone(telephone,code,pw)
+    return {code:redisCode}
+}
+
 module.exports = new userController();
\ No newline at end of file
diff --git a/docs/api.md b/docs/api.md
index b7584b6..a0c95af 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -14,8 +14,10 @@
 名称|类型|描述
 :--|:--|:--
 |loginName       |string     |必须, 登录名      |
-|password    |string     |必须,密码     |
-|type  | int    |用户类型:0管理员  1监课 2老师 4学生   |
+|password        |string     |必须,密码        |
+|userEmail       |string     |必须,邮箱        |
+|userMobile      |string     |必须,用户手机号   |
+
 
 请求示例:
    
@@ -23,10 +25,15 @@
 
       body  
           {
-            "loginName": "admin",
-            "telephone": 11112112,
+            "loginName": "尼安德特",
             "password": "123456",
-            "type":1
+            "companyName":"bat",
+            "userName":"尼安德特人",
+            "userRole":0,
+            "userEmail":"kengni@buyouyu.com",
+            "userMobile":123124,
+            "content":"2017-09-01",
+            "groupId":1
            }
 返回参数:
      
diff --git a/dump.rdb b/dump.rdb
new file mode 100644
index 0000000..2d2cee7
Binary files /dev/null and b/dump.rdb differ
diff --git a/model/studentMeetingModel.js b/model/studentMeetingModel.js
new file mode 100644
index 0000000..7e5b12d
--- /dev/null
+++ b/model/studentMeetingModel.js
@@ -0,0 +1,24 @@
+var  sequelize = require('../config');
+var Sequelize = require('sequelize');
+const uuid = require('../util/UuidUtil')
+
+var  user = sequelize.define('3m_student_meeting', {
+    id: {
+        type: Sequelize.STRING(32),
+        defaultValue:uuid.db32(),
+        allowNull: false,
+        unique: true,
+        primaryKey: true,
+        field: "id"
+    },
+    studentId: {
+        allowNull: false,        
+        type:Sequelize.STRING(32),
+        field: "student_id"
+    },
+    meetingId: {
+        allowNull: false,        
+        type:Sequelize.STRING(32),
+        field: "meeting_id"
+    },
+});    
\ No newline at end of file
diff --git a/model/userModel.js b/model/userModel.js
index d54fa5d..548ac24 100644
--- a/model/userModel.js
+++ b/model/userModel.js
@@ -17,6 +17,11 @@ var  user = sequelize.define('3m_user', {
         type:Sequelize.STRING(100),
         field: "login_name"
     },
+    IDcard: {
+        allowNull: false,        
+        type:Sequelize.STRING(50),
+        field: "IDcard"
+    },
     password: {
         allowNull: false,        
         type:Sequelize.STRING(100),
diff --git a/node_modules/double-ended-queue/.npmignore b/node_modules/double-ended-queue/.npmignore
new file mode 100644
index 0000000..bd236a0
--- /dev/null
+++ b/node_modules/double-ended-queue/.npmignore
@@ -0,0 +1,31 @@
+node_modules/*
+todo.txt
+npm-debug.log
+test/*
+benchmark/*
+browser/*
+src/*
+async
+sync
+mixed
+bench.json
+js/browser
+js/browser/*
+js/debug
+js/debug/*
+reader.js
+read.txt
+bench
+.editorconfig
+.jshintrc
+ast_passes.js
+mocharun.js
+throwaway.js
+throwaway.html
+deque.sublime-workspace
+deque.sublime-project
+changelog.js
+.travis.yml
+sauce_connect.log
+nodex64.exe
+bump.js
diff --git a/node_modules/double-ended-queue/Gruntfile.js b/node_modules/double-ended-queue/Gruntfile.js
new file mode 100644
index 0000000..7aed70d
--- /dev/null
+++ b/node_modules/double-ended-queue/Gruntfile.js
@@ -0,0 +1,188 @@
+"use strict";
+Error.stackTraceLimit = 100;
+var astPasses = require("./ast_passes.js");
+
+module.exports = function( grunt ) {
+    var isCI = !!grunt.option("ci");
+
+    var license;
+    function getLicense() {
+        if( !license ) {
+            var fs = require("fs");
+            var text = fs.readFileSync("LICENSE", "utf8");
+            text = text.split("\n").map(function(line, index){
+                return " * " + line;
+            }).join("\n")
+            license = "/**\n" + text + "\n */\n";
+        }
+        return license
+    }
+
+    function writeFile( dest, content ) {
+        grunt.file.write( dest, content );
+        grunt.log.writeln('File "' + dest + '" created.');
+    }
+
+    var gruntConfig = {};
+
+    var getGlobals = function() {
+        var fs = require("fs");
+        var file = "./src/constants.js";
+        var contents = fs.readFileSync(file, "utf8");
+        var rconstantname = /CONSTANT\(\s*([^,]+)/g;
+        var m;
+        var globals = {
+            "console": false,
+            "require": false,
+            "module": false,
+            "define": false
+        };
+        while( ( m = rconstantname.exec( contents ) ) ) {
+            globals[m[1]] = false;
+        }
+        return globals;
+    }
+
+    gruntConfig.pkg = grunt.file.readJSON("package.json");
+
+    gruntConfig.jshint = {
+        all: {
+            options: {
+                globals: getGlobals(),
+
+                "bitwise": false,
+                "camelcase": true,
+                "curly": true,
+                "eqeqeq": true,
+                "es3": true,
+                "forin": true,
+                "immed": true,
+                "latedef": false,
+                "newcap": true,
+                "noarg": true,
+                "noempty": true,
+                "nonew": true,
+                "plusplus": false,
+                "quotmark": "double",
+                "undef": true,
+                "unused": true,
+                "strict": false,
+                "trailing": true,
+                "maxparams": 7,
+                "maxlen": 80,
+
+                "asi": false,
+                "boss": true,
+                "eqnull": true,
+                "evil": true,
+                "expr": false,
+                "funcscope": false,
+                "globalstrict": false,
+                "lastsemic": false,
+                "laxcomma": false,
+                "laxbreak": false,
+                "loopfunc": true,
+                "multistr": true,
+                "proto": false,
+                "scripturl": true,
+                "smarttabs": false,
+                "shadow": true,
+                "sub": true,
+                "supernew": false,
+                "validthis": true,
+
+                "browser": true,
+                "jquery": true,
+                "devel": true,
+
+
+                '-W014': true,
+                '-W116': true,
+                '-W106': true,
+                '-W064': true,
+                '-W097': true
+            },
+
+            files: {
+                src: [
+                    "./src/deque.js"
+                ]
+            }
+        }
+    };
+
+    if( !isCI ) {
+        gruntConfig.jshint.all.options.reporter = require("jshint-stylish");
+    }
+
+    gruntConfig.bump = {
+      options: {
+        files: ['package.json'],
+        updateConfigs: [],
+        commit: true,
+        commitMessage: 'Release v%VERSION%',
+        commitFiles: ['-a'],
+        createTag: true,
+        tagName: 'v%VERSION%',
+        tagMessage: 'Version %VERSION%',
+        false: true,
+        pushTo: 'master',
+        gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
+      }
+    };
+
+    grunt.initConfig(gruntConfig);
+    grunt.loadNpmTasks('grunt-contrib-jshint');
+    grunt.loadNpmTasks('grunt-bump');
+
+
+    grunt.registerTask( "build", function() {
+        var fs = require("fs");
+        var CONSTANTS_FILE = "./src/constants.js";
+
+        astPasses.readConstants(fs.readFileSync(CONSTANTS_FILE, "utf8"), CONSTANTS_FILE);
+        var fileNames = ["deque.js"];
+        fileNames.forEach(function(fileName){
+            var src = fs.readFileSync("./src/" + fileName, "utf8");
+            src = astPasses.removeComments(src, fileName);
+            src = astPasses.expandConstants(src, fileName);
+            src = getLicense() + src;
+            writeFile("./js/" + fileName, src);
+        });
+    });
+
+    grunt.registerTask( "testrun", function() {
+        var fs = require("fs");
+        var done = this.async();
+        var Mocha = require("mocha");
+
+        var mochaOpts = {
+            reporter: "spec",
+            timeout: 500,
+            slow: Infinity
+        };
+
+        var mocha = new Mocha(mochaOpts);
+
+        fs.readdirSync("./test").forEach(function(fileName) {
+            mocha.addFile("./test/" + fileName);
+        });
+
+        mocha.run(function(err){
+            if( err ) {
+                process.stderr.write(test.title + "\n" + err.stack + "\n");
+                done(err);
+            }
+            else {
+                done();
+            }
+        }).on( "fail", function( test, err ) {
+            process.stderr.write(test.title + "\n" + err.stack + "\n");
+            done(err);
+        });
+    });
+
+    grunt.registerTask( "test", ["jshint", "build", "testrun"] );
+    grunt.registerTask( "default", ["jshint", "build"] );
+
+};
diff --git a/node_modules/double-ended-queue/LICENSE b/node_modules/double-ended-queue/LICENSE
new file mode 100644
index 0000000..abaadaa
--- /dev/null
+++ b/node_modules/double-ended-queue/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2013 Petka Antonov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:</p>
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/double-ended-queue/README.md b/node_modules/double-ended-queue/README.md
new file mode 100644
index 0000000..b1d115d
--- /dev/null
+++ b/node_modules/double-ended-queue/README.md
@@ -0,0 +1,293 @@
+#Introduction
+
+Extremely fast [double-ended queue](http://en.wikipedia.org/wiki/Double-ended_queue) implementation. Double-ended queue can also be used as a:
+
+- [Stack](http://en.wikipedia.org/wiki/Stack_\(abstract_data_type\))
+- [Queue](http://en.wikipedia.org/wiki/Queue_\(data_structure\))
+
+The implementation is GC and CPU cache friendly [circular buffer](http://en.wikipedia.org/wiki/Circular_buffer). [It will run circles around any "linked list" implementation](#performance).
+
+Every queue operation is done in constant `O(1)` - including random access from `.get()`.
+
+#Topics
+
+- [Quick start](#quick-start)
+- [Why not use an Array?](#why-not-use-an-array)
+- [Using double-ended queue as a normal queue](#using-double-ended-queue-as-a-normal-queue)
+- [API reference and examples](#api)
+- [Performance](#performance)
+
+#Quick start
+
+    npm install double-ended-queue
+
+```js
+var Deque = require("double-ended-queue");
+
+var deque = new Deque([1,2,3,4]);
+deque.shift(); //1
+deque.pop(); //4
+```
+
+#Why not use an Array?
+
+Arrays take linear `O(N)` time to do `shift` and `unshift` operations. That means in theory that an array with 1000 items is 1000x slower to do those operations than a deque with 1000 items. 10000x slower with 10000 items and so on.
+
+V8 implements [a trick for small arrays](https://code.google.com/p/v8/issues/detail?id=3059) where these operations are done in constant time, however even with this trick deque is still 4x faster.
+
+But arrays use "native" methods, they must be faster!
+
+In V8, there is almost no advantage for a method to be a built-in. In fact many times built-ins are at a severe disadvantage of having to implement far more complex semantics than is actually needed in practice. For example, sparse array handling punishes almost every built-in array method even though nobody uses sparse arrays as is evidenced by the popularity of the underscore library which doesn't handle sparse arrays in the same way across different browsers.
+
+#Using double-ended queue as a normal queue
+
+Queue is a more commonly needed data structure however a separate implementation does not provide any advantage in terms of performance. Aliases are provided specifically for the queue use-case. You may use `.enqueue(items...)` to enqueue item(s) and `.dequeue()` to dequeue an item.
+
+#API
+
+- [`new Deque()`](#new-deque---deque)
+- [`new Deque(Array items)`](#new-dequearray-items---deque)
+- [`new Deque(int capacity)`](#new-dequeint-capacity---deque)
+- [`push(dynamic items...)`](#pushdynamic-items---int)
+- [`unshift(dynamic items...)`](#unshiftdynamic-items---int)
+- [`pop()`](#pop---dynamic)
+- [`shift()`](#shift---dynamic)
+- [`toArray()`](#toarray---array)
+- [`peekBack()`](#peekback---dynamic)
+- [`peekFront()`](#peekfront---dynamic)
+- [`get(int index)`](#getint-index---dynamic)
+- [`isEmpty()`](#isempty---boolean)
+- [`clear()`](#clear---void)
+
+#####`new Deque()` -> `Deque`
+
+Creates an empty double-ended queue with initial capacity of 16. If you know the optimal size before-hand, use [`new Deque(int capacity)`](#new-dequeint-capacity---deque).
+
+```js
+var deque = new Deque();
+deque.push(1, 2, 3);
+deque.shift(); //1
+deque.pop(); //3
+```
+
+<hr>
+
+#####`new Deque(Array items)` -> `Deque`
+
+Creates a double-ended queue from `items`.
+
+```js
+var deque = new Deque([1,2,3,4]);
+deque.shift(); //1
+deque.pop(); //4
+```
+
+<hr>
+
+#####`new Deque(int capacity)` -> `Deque`
+
+Creates an empty double-ended queue with the given `capacity`. `Capacity` should be the maximum amount of items the queue will hold at a given time.
+
+The reason to give an initial capacity is to avoid potentially expensive resizing operations at runtime.
+
+```js
+var deque = new Deque(100);
+deque.push(1, 2, 3);
+deque.shift(); //1
+deque.pop(); //3
+```
+
+<hr>
+
+#####`push(dynamic items...)` -> `int`
+
+Push items to the back of this queue. Returns the amount of items currently in the queue after the operation.
+
+```js
+var deque = new Deque();
+deque.push(1);
+deque.pop(); //1
+deque.push(1, 2, 3);
+deque.shift(); //1
+deque.shift(); //2
+deque.shift(); //3
+```
+
+**Aliases:** `enqueue`, `insertBack`
+
+<hr>
+
+#####`unshift(dynamic items...)` -> `int`
+
+Unshift items to the front of this queue. Returns the amount of items currently in the queue after the operation.
+
+```js
+var deque = new Deque([2,3]);
+deque.unshift(1);
+deque.toString(); //"1,2,3"
+deque.unshift(-2, -1, 0);
+deque.toString(); //"-2,-1,0,1,2,3"
+```
+
+**Aliases:** `insertFront`
+
+<hr>
+
+
+#####`pop()` -> `dynamic`
+
+Pop off the item at the back of this queue.
+
+Note: The item will be removed from the queue. If you simply want to see what's at the back of the queue use [`peekBack()`](#peekback---dynamic) or [`.get(-1)`](#getint-index---dynamic).
+
+If the queue is empty, `undefined` is returned. If you need to differentiate between `undefined` values in the queue and `pop()` return value -
+check the queue `.length` before popping.
+
+```js
+var deque = new Deque([1,2,3]);
+deque.pop(); //3
+deque.pop(); //2
+deque.pop(); //1
+deque.pop(); //undefined
+```
+
+**Aliases:** `removeBack`
+
+<hr>
+
+#####`shift()` -> `dynamic`
+
+Shifts off the item at the front of this queue.
+
+Note: The item will be removed from the queue. If you simply want to see what's at the front of the queue use [`peekFront()`](#peekfront---dynamic) or [`.get(0)`](#getint-index---dynamic).
+
+If the queue is empty, `undefined` is returned. If you need to differentiate between `undefined` values in the queue and `shift()` return value -
+check the queue `.length` before shifting.
+
+```js
+var deque = new Deque([1,2,3]);
+deque.shift(); //1
+deque.shift(); //2
+deque.shift(); //3
+deque.shift(); //undefined
+```
+
+**Aliases:** `removeFront`, `dequeue`
+
+<hr>
+
+#####`toArray()` -> `Array`
+
+Returns the items in the queue as an array. Starting from the item in the front of the queue and ending to the item at the back of the queue.
+
+```js
+var deque = new Deque([1,2,3]);
+deque.push(4);
+deque.unshift(0);
+deque.toArray(); //[0,1,2,3,4]
+```
+
+**Aliases:** `toJSON`
+
+<hr>
+
+#####`peekBack()` -> `dynamic`
+
+Returns the item that is at the back of this queue without removing it.
+
+If the queue is empty, `undefined` is returned.
+
+```js
+var deque = new Deque([1,2,3]);
+deque.push(4);
+deque.peekBack(); //4
+```
+
+<hr>
+
+#####`peekFront()` -> `dynamic`
+
+Returns the item that is at the front of this queue without removing it.
+
+If the queue is empty, `undefined` is returned.
+
+```js
+var deque = new Deque([1,2,3]);
+deque.push(4);
+deque.peekFront(); //1
+```
+
+<hr>
+
+#####`get(int index)` -> `dynamic`
+
+Returns the item that is at the given `index` of this queue without removing it.
+
+The index is zero-based, so `.get(0)` will return the item that is at the front, `.get(1)` will return
+the item that comes after and so on.
+
+The index can be negative to read items at the back of the queue. `.get(-1)` returns the item that is at the back of the queue,
+`.get(-2)` will return the item that comes before and so on.
+
+Returns `undefined` if `index` is not a valid index into the queue.
+
+```js
+var deque = new Deque([1,2,3]);
+deque.get(0); //1
+deque.get(1); //2
+deque.get(2); //3
+
+deque.get(-1); //3
+deque.get(-2); //2
+deque.get(-3); //1
+```
+
+**Note**: Even though indexed accessor (e.g. `queue[0]`) could *appear* to return a correct value *sometimes*, this is completely unreliable. The numeric slots
+of the deque object are internally used as an optimization and have no meaningful order or meaning to outside. Always use `.get()`.
+
+**Note**: The implementation has O(1) random access using `.get()`.
+
+<hr>
+
+#####`isEmpty()` -> `boolean`
+
+Return `true` if this queue is empty, `false` otherwise.
+
+```js
+var deque = new Deque();
+deque.isEmpty(); //true
+deque.push(1);
+deque.isEmpty(); //false
+```
+
+<hr>
+
+#####`clear()` -> `void`
+
+Remove all items from this queue. Does not change the queue's capacity.
+
+```js
+var deque = new Deque([1,2,3]);
+deque.toString(); //"1,2,3"
+deque.clear();
+deque.toString(); //""
+```
+<hr>
+
+#Performance
+
+Clone the repo and `npm install`. Then run the `bench` script.
+
+##1000 items in the queue
+
+    double-ended-queue x 15,532,714 ops/sec ±0.19% (96 runs sampled)
+    built-in array x 6,501,398 ops/sec ±0.87% (95 runs sampled)
+    node-deque x 2,938,068 ops/sec ±3.50% (68 runs sampled)
+
+##2 million items in the queue
+
+    double-ended-queue x 14,425,547 ops/sec ±0.17% (94 runs sampled)
+    node-deque x 2,815,628 ops/sec ±10.56% (76 runs sampled)
+    built-in array x 19.23 ops/sec ±0.35% (51 runs sampled)
+
+Noteworthy is just how bad the degradation can be for built-in array when V8 cannot use the trick.
diff --git a/node_modules/double-ended-queue/js/deque.js b/node_modules/double-ended-queue/js/deque.js
new file mode 100644
index 0000000..fd463b9
--- /dev/null
+++ b/node_modules/double-ended-queue/js/deque.js
@@ -0,0 +1,275 @@
+/**
+ * Copyright (c) 2013 Petka Antonov
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:</p>
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+"use strict";
+function Deque(capacity) {
+    this._capacity = getCapacity(capacity);
+    this._length = 0;
+    this._front = 0;
+    if (isArray(capacity)) {
+        var len = capacity.length;
+        for (var i = 0; i < len; ++i) {
+            this[i] = capacity[i];
+        }
+        this._length = len;
+    }
+}
+
+Deque.prototype.toArray = function Deque$toArray() {
+    var len = this._length;
+    var ret = new Array(len);
+    var front = this._front;
+    var capacity = this._capacity;
+    for (var j = 0; j < len; ++j) {
+        ret[j] = this[(front + j) & (capacity - 1)];
+    }
+    return ret;
+};
+
+Deque.prototype.push = function Deque$push(item) {
+    var argsLength = arguments.length;
+    var length = this._length;
+    if (argsLength > 1) {
+        var capacity = this._capacity;
+        if (length + argsLength > capacity) {
+            for (var i = 0; i < argsLength; ++i) {
+                this._checkCapacity(length + 1);
+                var j = (this._front + length) & (this._capacity - 1);
+                this[j] = arguments[i];
+                length++;
+                this._length = length;
+            }
+            return length;
+        }
+        else {
+            var j = this._front;
+            for (var i = 0; i < argsLength; ++i) {
+                this[(j + length) & (capacity - 1)] = arguments[i];
+                j++;
+            }
+            this._length = length + argsLength;
+            return length + argsLength;
+        }
+
+    }
+
+    if (argsLength === 0) return length;
+
+    this._checkCapacity(length + 1);
+    var i = (this._front + length) & (this._capacity - 1);
+    this[i] = item;
+    this._length = length + 1;
+    return length + 1;
+};
+
+Deque.prototype.pop = function Deque$pop() {
+    var length = this._length;
+    if (length === 0) {
+        return void 0;
+    }
+    var i = (this._front + length - 1) & (this._capacity - 1);
+    var ret = this[i];
+    this[i] = void 0;
+    this._length = length - 1;
+    return ret;
+};
+
+Deque.prototype.shift = function Deque$shift() {
+    var length = this._length;
+    if (length === 0) {
+        return void 0;
+    }
+    var front = this._front;
+    var ret = this[front];
+    this[front] = void 0;
+    this._front = (front + 1) & (this._capacity - 1);
+    this._length = length - 1;
+    return ret;
+};
+
+Deque.prototype.unshift = function Deque$unshift(item) {
+    var length = this._length;
+    var argsLength = arguments.length;
+
+
+    if (argsLength > 1) {
+        var capacity = this._capacity;
+        if (length + argsLength > capacity) {
+            for (var i = argsLength - 1; i >= 0; i--) {
+                this._checkCapacity(length + 1);
+                var capacity = this._capacity;
+                var j = (((( this._front - 1 ) &
+                    ( capacity - 1) ) ^ capacity ) - capacity );
+                this[j] = arguments[i];
+                length++;
+                this._length = length;
+                this._front = j;
+            }
+            return length;
+        }
+        else {
+            var front = this._front;
+            for (var i = argsLength - 1; i >= 0; i--) {
+                var j = (((( front - 1 ) &
+                    ( capacity - 1) ) ^ capacity ) - capacity );
+                this[j] = arguments[i];
+                front = j;
+            }
+            this._front = front;
+            this._length = length + argsLength;
+            return length + argsLength;
+        }
+    }
+
+    if (argsLength === 0) return length;
+
+    this._checkCapacity(length + 1);
+    var capacity = this._capacity;
+    var i = (((( this._front - 1 ) &
+        ( capacity - 1) ) ^ capacity ) - capacity );
+    this[i] = item;
+    this._length = length + 1;
+    this._front = i;
+    return length + 1;
+};
+
+Deque.prototype.peekBack = function Deque$peekBack() {
+    var length = this._length;
+    if (length === 0) {
+        return void 0;
+    }
+    var index = (this._front + length - 1) & (this._capacity - 1);
+    return this[index];
+};
+
+Deque.prototype.peekFront = function Deque$peekFront() {
+    if (this._length === 0) {
+        return void 0;
+    }
+    return this[this._front];
+};
+
+Deque.prototype.get = function Deque$get(index) {
+    var i = index;
+    if ((i !== (i | 0))) {
+        return void 0;
+    }
+    var len = this._length;
+    if (i < 0) {
+        i = i + len;
+    }
+    if (i < 0 || i >= len) {
+        return void 0;
+    }
+    return this[(this._front + i) & (this._capacity - 1)];
+};
+
+Deque.prototype.isEmpty = function Deque$isEmpty() {
+    return this._length === 0;
+};
+
+Deque.prototype.clear = function Deque$clear() {
+    var len = this._length;
+    var front = this._front;
+    var capacity = this._capacity;
+    for (var j = 0; j < len; ++j) {
+        this[(front + j) & (capacity - 1)] = void 0;
+    }
+    this._length = 0;
+    this._front = 0;
+};
+
+Deque.prototype.toString = function Deque$toString() {
+    return this.toArray().toString();
+};
+
+Deque.prototype.valueOf = Deque.prototype.toString;
+Deque.prototype.removeFront = Deque.prototype.shift;
+Deque.prototype.removeBack = Deque.prototype.pop;
+Deque.prototype.insertFront = Deque.prototype.unshift;
+Deque.prototype.insertBack = Deque.prototype.push;
+Deque.prototype.enqueue = Deque.prototype.push;
+Deque.prototype.dequeue = Deque.prototype.shift;
+Deque.prototype.toJSON = Deque.prototype.toArray;
+
+Object.defineProperty(Deque.prototype, "length", {
+    get: function() {
+        return this._length;
+    },
+    set: function() {
+        throw new RangeError("");
+    }
+});
+
+Deque.prototype._checkCapacity = function Deque$_checkCapacity(size) {
+    if (this._capacity < size) {
+        this._resizeTo(getCapacity(this._capacity * 1.5 + 16));
+    }
+};
+
+Deque.prototype._resizeTo = function Deque$_resizeTo(capacity) {
+    var oldCapacity = this._capacity;
+    this._capacity = capacity;
+    var front = this._front;
+    var length = this._length;
+    if (front + length > oldCapacity) {
+        var moveItemsCount = (front + length) & (oldCapacity - 1);
+        arrayMove(this, 0, this, oldCapacity, moveItemsCount);
+    }
+};
+
+
+var isArray = Array.isArray;
+
+function arrayMove(src, srcIndex, dst, dstIndex, len) {
+    for (var j = 0; j < len; ++j) {
+        dst[j + dstIndex] = src[j + srcIndex];
+        src[j + srcIndex] = void 0;
+    }
+}
+
+function pow2AtLeast(n) {
+    n = n >>> 0;
+    n = n - 1;
+    n = n | (n >> 1);
+    n = n | (n >> 2);
+    n = n | (n >> 4);
+    n = n | (n >> 8);
+    n = n | (n >> 16);
+    return n + 1;
+}
+
+function getCapacity(capacity) {
+    if (typeof capacity !== "number") {
+        if (isArray(capacity)) {
+            capacity = capacity.length;
+        }
+        else {
+            return 16;
+        }
+    }
+    return pow2AtLeast(
+        Math.min(
+            Math.max(16, capacity), 1073741824)
+    );
+}
+
+module.exports = Deque;
diff --git a/node_modules/double-ended-queue/package.json b/node_modules/double-ended-queue/package.json
new file mode 100644
index 0000000..af8d5f9
--- /dev/null
+++ b/node_modules/double-ended-queue/package.json
@@ -0,0 +1,101 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "double-ended-queue@^2.1.0-0",
+        "scope": null,
+        "escapedName": "double-ended-queue",
+        "name": "double-ended-queue",
+        "rawSpec": "^2.1.0-0",
+        "spec": ">=2.1.0-0 <3.0.0",
+        "type": "range"
+      },
+      "/Users/fzy/project/koa2_Sequelize_project/node_modules/redis"
+    ]
+  ],
+  "_from": "double-ended-queue@>=2.1.0-0 <3.0.0",
+  "_id": "double-ended-queue@2.1.0-0",
+  "_inCache": true,
+  "_location": "/double-ended-queue",
+  "_nodeVersion": "0.10.34",
+  "_npmUser": {
+    "name": "esailija",
+    "email": "petka_antonov@hotmail.com"
+  },
+  "_npmVersion": "2.1.12",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "double-ended-queue@^2.1.0-0",
+    "scope": null,
+    "escapedName": "double-ended-queue",
+    "name": "double-ended-queue",
+    "rawSpec": "^2.1.0-0",
+    "spec": ">=2.1.0-0 <3.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/redis"
+  ],
+  "_resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz",
+  "_shasum": "103d3527fd31528f40188130c841efdd78264e5c",
+  "_shrinkwrap": null,
+  "_spec": "double-ended-queue@^2.1.0-0",
+  "_where": "/Users/fzy/project/koa2_Sequelize_project/node_modules/redis",
+  "author": {
+    "name": "Petka Antonov",
+    "email": "petka_antonov@hotmail.com",
+    "url": "http://github.com/petkaantonov/"
+  },
+  "bugs": {
+    "url": "http://github.com/petkaantonov/deque/issues"
+  },
+  "dependencies": {},
+  "description": "Extremely fast double-ended queue implementation",
+  "devDependencies": {
+    "acorn": "~0.3.1",
+    "benchmark": "~1.0.0",
+    "bluebird": "~0.11",
+    "deque": "0.0.4",
+    "grunt": "~0.4.1",
+    "grunt-cli": "~0.1.9",
+    "grunt-contrib-jshint": "~0.6.4",
+    "jshint-stylish": "latest",
+    "mocha": "~1.12.1",
+    "q": "~0.9.7",
+    "semver-utils": "~1.1.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "103d3527fd31528f40188130c841efdd78264e5c",
+    "tarball": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz"
+  },
+  "gitHead": "51eada75cea686f1eb0c8bb5be486ac630e9b7ee",
+  "homepage": "https://github.com/petkaantonov/deque",
+  "keywords": [
+    "data-structure",
+    "data-structures",
+    "queue",
+    "deque",
+    "double-ended-queue"
+  ],
+  "license": "MIT",
+  "main": "./js/deque.js",
+  "maintainers": [
+    {
+      "name": "esailija",
+      "email": "petka_antonov@hotmail.com"
+    }
+  ],
+  "name": "double-ended-queue",
+  "optionalDependencies": {},
+  "readme": "#Introduction\n\nExtremely fast [double-ended queue](http://en.wikipedia.org/wiki/Double-ended_queue) implementation. Double-ended queue can also be used as a:\n\n- [Stack](http://en.wikipedia.org/wiki/Stack_\\(abstract_data_type\\))\n- [Queue](http://en.wikipedia.org/wiki/Queue_\\(data_structure\\))\n\nThe implementation is GC and CPU cache friendly [circular buffer](http://en.wikipedia.org/wiki/Circular_buffer). [It will run circles around any \"linked list\" implementation](#performance).\n\nEvery queue operation is done in constant `O(1)` - including random access from `.get()`.\n\n#Topics\n\n- [Quick start](#quick-start)\n- [Why not use an Array?](#why-not-use-an-array)\n- [Using double-ended queue as a normal queue](#using-double-ended-queue-as-a-normal-queue)\n- [API reference and examples](#api)\n- [Performance](#performance)\n\n#Quick start\n\n    npm install double-ended-queue\n\n```js\nvar Deque = require(\"double-ended-queue\");\n\nvar deque = new Deque([1,2,3,4]);\ndeque.shift(); //1\ndeque.pop(); //4\n```\n\n#Why not use an Array?\n\nArrays take linear `O(N)` time to do `shift` and `unshift` operations. That means in theory that an array with 1000 items is 1000x slower to do those operations than a deque with 1000 items. 10000x slower with 10000 items and so on.\n\nV8 implements [a trick for small arrays](https://code.google.com/p/v8/issues/detail?id=3059) where these operations are done in constant time, however even with this trick deque is still 4x faster.\n\nBut arrays use \"native\" methods, they must be faster!\n\nIn V8, there is almost no advantage for a method to be a built-in. In fact many times built-ins are at a severe disadvantage of having to implement far more complex semantics than is actually needed in practice. For example, sparse array handling punishes almost every built-in array method even though nobody uses sparse arrays as is evidenced by the popularity of the underscore library which doesn't handle sparse arrays in the same way across different browsers.\n\n#Using double-ended queue as a normal queue\n\nQueue is a more commonly needed data structure however a separate implementation does not provide any advantage in terms of performance. Aliases are provided specifically for the queue use-case. You may use `.enqueue(items...)` to enqueue item(s) and `.dequeue()` to dequeue an item.\n\n#API\n\n- [`new Deque()`](#new-deque---deque)\n- [`new Deque(Array items)`](#new-dequearray-items---deque)\n- [`new Deque(int capacity)`](#new-dequeint-capacity---deque)\n- [`push(dynamic items...)`](#pushdynamic-items---int)\n- [`unshift(dynamic items...)`](#unshiftdynamic-items---int)\n- [`pop()`](#pop---dynamic)\n- [`shift()`](#shift---dynamic)\n- [`toArray()`](#toarray---array)\n- [`peekBack()`](#peekback---dynamic)\n- [`peekFront()`](#peekfront---dynamic)\n- [`get(int index)`](#getint-index---dynamic)\n- [`isEmpty()`](#isempty---boolean)\n- [`clear()`](#clear---void)\n\n#####`new Deque()` -> `Deque`\n\nCreates an empty double-ended queue with initial capacity of 16. If you know the optimal size before-hand, use [`new Deque(int capacity)`](#new-dequeint-capacity---deque).\n\n```js\nvar deque = new Deque();\ndeque.push(1, 2, 3);\ndeque.shift(); //1\ndeque.pop(); //3\n```\n\n<hr>\n\n#####`new Deque(Array items)` -> `Deque`\n\nCreates a double-ended queue from `items`.\n\n```js\nvar deque = new Deque([1,2,3,4]);\ndeque.shift(); //1\ndeque.pop(); //4\n```\n\n<hr>\n\n#####`new Deque(int capacity)` -> `Deque`\n\nCreates an empty double-ended queue with the given `capacity`. `Capacity` should be the maximum amount of items the queue will hold at a given time.\n\nThe reason to give an initial capacity is to avoid potentially expensive resizing operations at runtime.\n\n```js\nvar deque = new Deque(100);\ndeque.push(1, 2, 3);\ndeque.shift(); //1\ndeque.pop(); //3\n```\n\n<hr>\n\n#####`push(dynamic items...)` -> `int`\n\nPush items to the back of this queue. Returns the amount of items currently in the queue after the operation.\n\n```js\nvar deque = new Deque();\ndeque.push(1);\ndeque.pop(); //1\ndeque.push(1, 2, 3);\ndeque.shift(); //1\ndeque.shift(); //2\ndeque.shift(); //3\n```\n\n**Aliases:** `enqueue`, `insertBack`\n\n<hr>\n\n#####`unshift(dynamic items...)` -> `int`\n\nUnshift items to the front of this queue. Returns the amount of items currently in the queue after the operation.\n\n```js\nvar deque = new Deque([2,3]);\ndeque.unshift(1);\ndeque.toString(); //\"1,2,3\"\ndeque.unshift(-2, -1, 0);\ndeque.toString(); //\"-2,-1,0,1,2,3\"\n```\n\n**Aliases:** `insertFront`\n\n<hr>\n\n\n#####`pop()` -> `dynamic`\n\nPop off the item at the back of this queue.\n\nNote: The item will be removed from the queue. If you simply want to see what's at the back of the queue use [`peekBack()`](#peekback---dynamic) or [`.get(-1)`](#getint-index---dynamic).\n\nIf the queue is empty, `undefined` is returned. If you need to differentiate between `undefined` values in the queue and `pop()` return value -\ncheck the queue `.length` before popping.\n\n```js\nvar deque = new Deque([1,2,3]);\ndeque.pop(); //3\ndeque.pop(); //2\ndeque.pop(); //1\ndeque.pop(); //undefined\n```\n\n**Aliases:** `removeBack`\n\n<hr>\n\n#####`shift()` -> `dynamic`\n\nShifts off the item at the front of this queue.\n\nNote: The item will be removed from the queue. If you simply want to see what's at the front of the queue use [`peekFront()`](#peekfront---dynamic) or [`.get(0)`](#getint-index---dynamic).\n\nIf the queue is empty, `undefined` is returned. If you need to differentiate between `undefined` values in the queue and `shift()` return value -\ncheck the queue `.length` before shifting.\n\n```js\nvar deque = new Deque([1,2,3]);\ndeque.shift(); //1\ndeque.shift(); //2\ndeque.shift(); //3\ndeque.shift(); //undefined\n```\n\n**Aliases:** `removeFront`, `dequeue`\n\n<hr>\n\n#####`toArray()` -> `Array`\n\nReturns the items in the queue as an array. Starting from the item in the front of the queue and ending to the item at the back of the queue.\n\n```js\nvar deque = new Deque([1,2,3]);\ndeque.push(4);\ndeque.unshift(0);\ndeque.toArray(); //[0,1,2,3,4]\n```\n\n**Aliases:** `toJSON`\n\n<hr>\n\n#####`peekBack()` -> `dynamic`\n\nReturns the item that is at the back of this queue without removing it.\n\nIf the queue is empty, `undefined` is returned.\n\n```js\nvar deque = new Deque([1,2,3]);\ndeque.push(4);\ndeque.peekBack(); //4\n```\n\n<hr>\n\n#####`peekFront()` -> `dynamic`\n\nReturns the item that is at the front of this queue without removing it.\n\nIf the queue is empty, `undefined` is returned.\n\n```js\nvar deque = new Deque([1,2,3]);\ndeque.push(4);\ndeque.peekFront(); //1\n```\n\n<hr>\n\n#####`get(int index)` -> `dynamic`\n\nReturns the item that is at the given `index` of this queue without removing it.\n\nThe index is zero-based, so `.get(0)` will return the item that is at the front, `.get(1)` will return\nthe item that comes after and so on.\n\nThe index can be negative to read items at the back of the queue. `.get(-1)` returns the item that is at the back of the queue,\n`.get(-2)` will return the item that comes before and so on.\n\nReturns `undefined` if `index` is not a valid index into the queue.\n\n```js\nvar deque = new Deque([1,2,3]);\ndeque.get(0); //1\ndeque.get(1); //2\ndeque.get(2); //3\n\ndeque.get(-1); //3\ndeque.get(-2); //2\ndeque.get(-3); //1\n```\n\n**Note**: Even though indexed accessor (e.g. `queue[0]`) could *appear* to return a correct value *sometimes*, this is completely unreliable. The numeric slots\nof the deque object are internally used as an optimization and have no meaningful order or meaning to outside. Always use `.get()`.\n\n**Note**: The implementation has O(1) random access using `.get()`.\n\n<hr>\n\n#####`isEmpty()` -> `boolean`\n\nReturn `true` if this queue is empty, `false` otherwise.\n\n```js\nvar deque = new Deque();\ndeque.isEmpty(); //true\ndeque.push(1);\ndeque.isEmpty(); //false\n```\n\n<hr>\n\n#####`clear()` -> `void`\n\nRemove all items from this queue. Does not change the queue's capacity.\n\n```js\nvar deque = new Deque([1,2,3]);\ndeque.toString(); //\"1,2,3\"\ndeque.clear();\ndeque.toString(); //\"\"\n```\n<hr>\n\n#Performance\n\nClone the repo and `npm install`. Then run the `bench` script.\n\n##1000 items in the queue\n\n    double-ended-queue x 15,532,714 ops/sec ±0.19% (96 runs sampled)\n    built-in array x 6,501,398 ops/sec ±0.87% (95 runs sampled)\n    node-deque x 2,938,068 ops/sec ±3.50% (68 runs sampled)\n\n##2 million items in the queue\n\n    double-ended-queue x 14,425,547 ops/sec ±0.17% (94 runs sampled)\n    node-deque x 2,815,628 ops/sec ±10.56% (76 runs sampled)\n    built-in array x 19.23 ops/sec ±0.35% (51 runs sampled)\n\nNoteworthy is just how bad the degradation can be for built-in array when V8 cannot use the trick.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/petkaantonov/deque.git"
+  },
+  "scripts": {
+    "test": "grunt test"
+  },
+  "version": "2.1.0-0"
+}
diff --git a/node_modules/redis-commands/.npmignore b/node_modules/redis-commands/.npmignore
new file mode 100644
index 0000000..145db3d
--- /dev/null
+++ b/node_modules/redis-commands/.npmignore
@@ -0,0 +1,29 @@
+# Logs
+logs
+*.log
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.rdb
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Compiled binary addons (http://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directory
+# Commenting this out is preferred by some people, see
+# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
+node_modules
+
+# Users Environment Variables
+.lock-wscript
diff --git a/node_modules/redis-commands/.travis.yml b/node_modules/redis-commands/.travis.yml
new file mode 100644
index 0000000..c4bb7d2
--- /dev/null
+++ b/node_modules/redis-commands/.travis.yml
@@ -0,0 +1,9 @@
+language: node_js
+sudo: false
+node_js:
+  - "0.10"
+  - "0.12"
+  - "4"
+  - "5"
+after_success:
+  - CODECLIMATE_REPO_TOKEN=b57723fafcf0516f275d6b380cd506fd082ea88d86507eb82c8abd489b9b9a09 node ./node_modules/.bin/codeclimate-test-reporter < coverage/lcov.info
diff --git a/node_modules/redis-commands/LICENSE b/node_modules/redis-commands/LICENSE
new file mode 100644
index 0000000..39d23f8
--- /dev/null
+++ b/node_modules/redis-commands/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 NodeRedis
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/node_modules/redis-commands/README.md b/node_modules/redis-commands/README.md
new file mode 100644
index 0000000..de51822
--- /dev/null
+++ b/node_modules/redis-commands/README.md
@@ -0,0 +1,51 @@
+# Redis Commands
+
+[![Build Status](https://travis-ci.org/NodeRedis/redis-commands.png?branch=master)](https://travis-ci.org/NodeRedis/redis-commands)
+[![Code Climate](https://codeclimate.com/github/NodeRedis/redis-commands/badges/gpa.svg)](https://codeclimate.com/github/NodeRedis/redis-commands)
+[![Test Coverage](https://codeclimate.com/github/NodeRedis/redis-commands/badges/coverage.svg)](https://codeclimate.com/github/NodeRedis/redis-commands/coverage)
+
+This module exports all the commands that Redis supports.
+
+## Install
+
+```shell
+$ npm install redis-commands
+```
+
+## Usage
+
+```javascript
+var commands = require('redis-commands');
+```
+
+`.list` is an array contains all the lowercased commands:
+
+```javascript
+commands.list.forEach(function (command) {
+  console.log(command);
+});
+```
+
+`.exists()` is used to check if the command exists:
+
+```javascript
+commands.exists('set') // true
+commands.exists('other-command') // false
+```
+
+`.hasFlag()` is used to check if the command has the flag:
+
+```javascript
+commands.hasFlag('set', 'readonly') // false
+```
+
+`.getKeyIndexes()` is used to get the indexes of keys in the command arguments:
+
+```javascript
+commands.getKeyIndexes('set', ['key', 'value']) // [0]
+commands.getKeyIndexes('mget', ['key1', 'key2']) // [0, 1]
+```
+
+## Acknowledgment
+
+Thank [@Yuan Chuan](https://github.com/yuanchuan) for the package name. The original redis-commands is renamed to [@yuanchuan/redis-commands](https://www.npmjs.com/package/@yuanchuan/redis-commands).
diff --git a/node_modules/redis-commands/changelog.md b/node_modules/redis-commands/changelog.md
new file mode 100644
index 0000000..d06ca3c
--- /dev/null
+++ b/node_modules/redis-commands/changelog.md
@@ -0,0 +1,32 @@
+## v.1.3.1 - 25 Jan, 2017
+
+Bugfix
+
+-  Fix require for for webpack
+
+## v.1.3.0 - 20 Oct, 2016
+
+Features
+
+-  Rebuild the commands with the newest Redis unstable release
+
+## v.1.2.0 - 21 Apr, 2016
+
+Features
+
+-  Added support for `MIGRATE [...] KEYS key1, key2` (Redis >= v.3.0.6)
+-  Added build sanity check for unhandled commands with moveable keys
+-  Rebuild the commands with the newest unstable release
+-  Improved performance of .getKeyIndexes()
+
+Bugfix
+
+-  Fixed command command returning the wrong arity due to a Redis bug
+-  Fixed brpop command returning the wrong keystop due to a Redis bug
+
+## v.1.1.0 - 09 Feb, 2016
+
+Features
+
+-  Added .exists() to check for command existence
+-  Improved performance of .hasFlag()
diff --git a/node_modules/redis-commands/commands.json b/node_modules/redis-commands/commands.json
new file mode 100644
index 0000000..e9f0dcf
--- /dev/null
+++ b/node_modules/redis-commands/commands.json
@@ -0,0 +1,1796 @@
+{
+  "append": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "asking": {
+    "arity": 1,
+    "flags": [
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "auth": {
+    "arity": 2,
+    "flags": [
+      "noscript",
+      "loading",
+      "stale",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "bgrewriteaof": {
+    "arity": 1,
+    "flags": [
+      "admin"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "bgsave": {
+    "arity": -1,
+    "flags": [
+      "admin"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "bitcount": {
+    "arity": -2,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "bitfield": {
+    "arity": -2,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "bitop": {
+    "arity": -4,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 2,
+    "keyStop": -1,
+    "step": 1
+  },
+  "bitpos": {
+    "arity": -3,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "blpop": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "noscript"
+    ],
+    "keyStart": 1,
+    "keyStop": -2,
+    "step": 1
+  },
+  "brpop": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "noscript"
+    ],
+    "keyStart": 1,
+    "keyStop": -2,
+    "step": 1
+  },
+  "brpoplpush": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom",
+      "noscript"
+    ],
+    "keyStart": 1,
+    "keyStop": 2,
+    "step": 1
+  },
+  "client": {
+    "arity": -2,
+    "flags": [
+      "admin",
+      "noscript"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "cluster": {
+    "arity": -2,
+    "flags": [
+      "admin"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "command": {
+    "arity": 1,
+    "flags": [
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "config": {
+    "arity": -2,
+    "flags": [
+      "admin",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "dbsize": {
+    "arity": 1,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "debug": {
+    "arity": -1,
+    "flags": [
+      "admin",
+      "noscript"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "decr": {
+    "arity": 2,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "decrby": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "del": {
+    "arity": -2,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "discard": {
+    "arity": 1,
+    "flags": [
+      "noscript",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "dump": {
+    "arity": 2,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "echo": {
+    "arity": 2,
+    "flags": [
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "eval": {
+    "arity": -3,
+    "flags": [
+      "noscript",
+      "movablekeys"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "evalsha": {
+    "arity": -3,
+    "flags": [
+      "noscript",
+      "movablekeys"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "exec": {
+    "arity": 1,
+    "flags": [
+      "noscript",
+      "skip_monitor"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "exists": {
+    "arity": -2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "expire": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "expireat": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "flushall": {
+    "arity": -1,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "flushdb": {
+    "arity": -1,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "geoadd": {
+    "arity": -5,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "geodist": {
+    "arity": -4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "geohash": {
+    "arity": -2,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "geopos": {
+    "arity": -2,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "georadius": {
+    "arity": -6,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "georadiusbymember": {
+    "arity": -5,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "get": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "getbit": {
+    "arity": 3,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "getrange": {
+    "arity": 4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "getset": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hdel": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hexists": {
+    "arity": 3,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hget": {
+    "arity": 3,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hgetall": {
+    "arity": 2,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hincrby": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hincrbyfloat": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hkeys": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "sort_for_script"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hlen": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hmget": {
+    "arity": -3,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hmset": {
+    "arity": -4,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "host:": {
+    "arity": -1,
+    "flags": [
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "hscan": {
+    "arity": -3,
+    "flags": [
+      "readonly",
+      "random"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hset": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hsetnx": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hstrlen": {
+    "arity": 3,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "hvals": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "sort_for_script"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "incr": {
+    "arity": 2,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "incrby": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "incrbyfloat": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "info": {
+    "arity": -1,
+    "flags": [
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "keys": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "sort_for_script"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "lastsave": {
+    "arity": 1,
+    "flags": [
+      "random",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "latency": {
+    "arity": -2,
+    "flags": [
+      "admin",
+      "noscript",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "lindex": {
+    "arity": 3,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "linsert": {
+    "arity": 5,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "llen": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "lpop": {
+    "arity": 2,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "lpush": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "lpushx": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "lrange": {
+    "arity": 4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "lrem": {
+    "arity": 4,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "lset": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "ltrim": {
+    "arity": 4,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "memory": {
+    "arity": -2,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "mget": {
+    "arity": -2,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "migrate": {
+    "arity": -6,
+    "flags": [
+      "write",
+      "movablekeys"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "module": {
+    "arity": -2,
+    "flags": [
+      "admin",
+      "noscript"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "monitor": {
+    "arity": 1,
+    "flags": [
+      "admin",
+      "noscript"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "move": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "mset": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 2
+  },
+  "msetnx": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 2
+  },
+  "multi": {
+    "arity": 1,
+    "flags": [
+      "noscript",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "object": {
+    "arity": 3,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 2,
+    "keyStop": 2,
+    "step": 2
+  },
+  "persist": {
+    "arity": 2,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "pexpire": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "pexpireat": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "pfadd": {
+    "arity": -2,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "pfcount": {
+    "arity": -2,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "pfdebug": {
+    "arity": -3,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "pfmerge": {
+    "arity": -2,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "pfselftest": {
+    "arity": 1,
+    "flags": [
+      "admin"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "ping": {
+    "arity": -1,
+    "flags": [
+      "stale",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "post": {
+    "arity": -1,
+    "flags": [
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "psetex": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "psubscribe": {
+    "arity": -2,
+    "flags": [
+      "pubsub",
+      "noscript",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "psync": {
+    "arity": 3,
+    "flags": [
+      "readonly",
+      "admin",
+      "noscript"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "pttl": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "publish": {
+    "arity": 3,
+    "flags": [
+      "pubsub",
+      "loading",
+      "stale",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "pubsub": {
+    "arity": -2,
+    "flags": [
+      "pubsub",
+      "random",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "punsubscribe": {
+    "arity": -1,
+    "flags": [
+      "pubsub",
+      "noscript",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "quit": {
+    "arity": 1,
+    "flags": [
+      "loading",
+      "stale",
+      "readonly"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "randomkey": {
+    "arity": 1,
+    "flags": [
+      "readonly",
+      "random"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "readonly": {
+    "arity": 1,
+    "flags": [
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "readwrite": {
+    "arity": 1,
+    "flags": [
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "rename": {
+    "arity": 3,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 1,
+    "keyStop": 2,
+    "step": 1
+  },
+  "renamenx": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 2,
+    "step": 1
+  },
+  "replconf": {
+    "arity": -1,
+    "flags": [
+      "admin",
+      "noscript",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "restore": {
+    "arity": -4,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "restore-asking": {
+    "arity": -4,
+    "flags": [
+      "write",
+      "denyoom",
+      "asking"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "role": {
+    "arity": 1,
+    "flags": [
+      "noscript",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "rpop": {
+    "arity": 2,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "rpoplpush": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 2,
+    "step": 1
+  },
+  "rpush": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "rpushx": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "sadd": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "save": {
+    "arity": 1,
+    "flags": [
+      "admin",
+      "noscript"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "scan": {
+    "arity": -2,
+    "flags": [
+      "readonly",
+      "random"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "scard": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "script": {
+    "arity": -2,
+    "flags": [
+      "noscript"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "sdiff": {
+    "arity": -2,
+    "flags": [
+      "readonly",
+      "sort_for_script"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "sdiffstore": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "select": {
+    "arity": 2,
+    "flags": [
+      "loading",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "set": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "setbit": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "setex": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "setnx": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "setrange": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "shutdown": {
+    "arity": -1,
+    "flags": [
+      "admin",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "sinter": {
+    "arity": -2,
+    "flags": [
+      "readonly",
+      "sort_for_script"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "sinterstore": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "sismember": {
+    "arity": 3,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "slaveof": {
+    "arity": 3,
+    "flags": [
+      "admin",
+      "noscript",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "slowlog": {
+    "arity": -2,
+    "flags": [
+      "admin"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "smembers": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "sort_for_script"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "smove": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 2,
+    "step": 1
+  },
+  "sort": {
+    "arity": -2,
+    "flags": [
+      "write",
+      "denyoom",
+      "movablekeys"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "spop": {
+    "arity": -2,
+    "flags": [
+      "write",
+      "random",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "srandmember": {
+    "arity": -2,
+    "flags": [
+      "readonly",
+      "random"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "srem": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "sscan": {
+    "arity": -3,
+    "flags": [
+      "readonly",
+      "random"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "strlen": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "subscribe": {
+    "arity": -2,
+    "flags": [
+      "pubsub",
+      "noscript",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "substr": {
+    "arity": 4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "sunion": {
+    "arity": -2,
+    "flags": [
+      "readonly",
+      "sort_for_script"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "sunionstore": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "denyoom"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "swapdb": {
+    "arity": 3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "sync": {
+    "arity": 1,
+    "flags": [
+      "readonly",
+      "admin",
+      "noscript"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "time": {
+    "arity": 1,
+    "flags": [
+      "random",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "touch": {
+    "arity": -2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "ttl": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "type": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "unlink": {
+    "arity": -2,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "unsubscribe": {
+    "arity": -1,
+    "flags": [
+      "pubsub",
+      "noscript",
+      "loading",
+      "stale"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "unwatch": {
+    "arity": 1,
+    "flags": [
+      "noscript",
+      "fast"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "wait": {
+    "arity": 3,
+    "flags": [
+      "noscript"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "watch": {
+    "arity": -2,
+    "flags": [
+      "noscript",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": -1,
+    "step": 1
+  },
+  "zadd": {
+    "arity": -4,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zcard": {
+    "arity": 2,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zcount": {
+    "arity": 4,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zincrby": {
+    "arity": 4,
+    "flags": [
+      "write",
+      "denyoom",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zinterstore": {
+    "arity": -4,
+    "flags": [
+      "write",
+      "denyoom",
+      "movablekeys"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  },
+  "zlexcount": {
+    "arity": 4,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zrange": {
+    "arity": -4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zrangebylex": {
+    "arity": -4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zrangebyscore": {
+    "arity": -4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zrank": {
+    "arity": 3,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zrem": {
+    "arity": -3,
+    "flags": [
+      "write",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zremrangebylex": {
+    "arity": 4,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zremrangebyrank": {
+    "arity": 4,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zremrangebyscore": {
+    "arity": 4,
+    "flags": [
+      "write"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zrevrange": {
+    "arity": -4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zrevrangebylex": {
+    "arity": -4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zrevrangebyscore": {
+    "arity": -4,
+    "flags": [
+      "readonly"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zrevrank": {
+    "arity": 3,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zscan": {
+    "arity": -3,
+    "flags": [
+      "readonly",
+      "random"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zscore": {
+    "arity": 3,
+    "flags": [
+      "readonly",
+      "fast"
+    ],
+    "keyStart": 1,
+    "keyStop": 1,
+    "step": 1
+  },
+  "zunionstore": {
+    "arity": -4,
+    "flags": [
+      "write",
+      "denyoom",
+      "movablekeys"
+    ],
+    "keyStart": 0,
+    "keyStop": 0,
+    "step": 0
+  }
+}
\ No newline at end of file
diff --git a/node_modules/redis-commands/index.js b/node_modules/redis-commands/index.js
new file mode 100644
index 0000000..8b58437
--- /dev/null
+++ b/node_modules/redis-commands/index.js
@@ -0,0 +1,155 @@
+'use strict'
+
+var commands = require('./commands.json')
+
+/**
+ * Redis command list
+ *
+ * All commands are lowercased.
+ *
+ * @var {string[]}
+ * @public
+ */
+exports.list = Object.keys(commands)
+
+var flags = {}
+exports.list.forEach(function (commandName) {
+  flags[commandName] = commands[commandName].flags.reduce(function (flags, flag) {
+    flags[flag] = true
+    return flags
+  }, {})
+})
+/**
+ * Check if the command exists
+ *
+ * @param {string} commandName - the command name
+ * @return {boolean} result
+ * @public
+ */
+exports.exists = function (commandName) {
+  return Boolean(commands[commandName])
+}
+
+/**
+ * Check if the command has the flag
+ *
+ * Some of possible flags: readonly, noscript, loading
+ * @param {string} commandName - the command name
+ * @param {string} flag - the flag to check
+ * @return {boolean} result
+ * @public
+ */
+exports.hasFlag = function (commandName, flag) {
+  if (!flags[commandName]) {
+    throw new Error('Unknown command ' + commandName)
+  }
+
+  return Boolean(flags[commandName][flag])
+}
+
+/**
+ * Get indexes of keys in the command arguments
+ *
+ * @param {string} commandName - the command name
+ * @param {string[]} args - the arguments of the command
+ * @param {object} [options] - options
+ * @param {boolean} [options.parseExternalKey] - parse external keys
+ * @return {number[]} - the list of the index
+ * @public
+ *
+ * @example
+ * ```javascript
+ * getKeyIndexes('set', ['key', 'value']) // [0]
+ * getKeyIndexes('mget', ['key1', 'key2']) // [0, 1]
+ * ```
+ */
+exports.getKeyIndexes = function (commandName, args, options) {
+  var command = commands[commandName]
+  if (!command) {
+    throw new Error('Unknown command ' + commandName)
+  }
+
+  if (!Array.isArray(args)) {
+    throw new Error('Expect args to be an array')
+  }
+
+  var keys = []
+  var i, keyStart, keyStop, parseExternalKey
+  switch (commandName) {
+    case 'zunionstore':
+    case 'zinterstore':
+      keys.push(0)
+    // fall through
+    case 'eval':
+    case 'evalsha':
+      keyStop = Number(args[1]) + 2
+      for (i = 2; i < keyStop; i++) {
+        keys.push(i)
+      }
+      break
+    case 'sort':
+      parseExternalKey = options && options.parseExternalKey
+      keys.push(0)
+      for (i = 1; i < args.length - 1; i++) {
+        if (typeof args[i] !== 'string') {
+          continue
+        }
+        var directive = args[i].toUpperCase()
+        if (directive === 'GET') {
+          i += 1
+          if (args[i] !== '#') {
+            if (parseExternalKey) {
+              keys.push([i, getExternalKeyNameLength(args[i])])
+            } else {
+              keys.push(i)
+            }
+          }
+        } else if (directive === 'BY') {
+          i += 1
+          if (parseExternalKey) {
+            keys.push([i, getExternalKeyNameLength(args[i])])
+          } else {
+            keys.push(i)
+          }
+        } else if (directive === 'STORE') {
+          i += 1
+          keys.push(i)
+        }
+      }
+      break
+    case 'migrate':
+      if (args[2] === '') {
+        for (i = 5; i < args.length - 1; i++) {
+          if (args[i].toUpperCase() === 'KEYS') {
+            for (var j = i + 1; j < args.length; j++) {
+              keys.push(j)
+            }
+            break
+          }
+        }
+      } else {
+        keys.push(2)
+      }
+      break
+    default:
+    // step has to be at least one in this case, otherwise the command does not contain a key
+      if (command.step > 0) {
+        keyStart = command.keyStart - 1
+        keyStop = command.keyStop > 0 ? command.keyStop : args.length + command.keyStop + 1
+        for (i = keyStart; i < keyStop; i += command.step) {
+          keys.push(i)
+        }
+      }
+      break
+  }
+
+  return keys
+}
+
+function getExternalKeyNameLength (key) {
+  if (typeof key !== 'string') {
+    key = String(key)
+  }
+  var hashPos = key.indexOf('->')
+  return hashPos === -1 ? key.length : hashPos
+}
diff --git a/node_modules/redis-commands/package.json b/node_modules/redis-commands/package.json
new file mode 100644
index 0000000..3fcbe2c
--- /dev/null
+++ b/node_modules/redis-commands/package.json
@@ -0,0 +1,110 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "redis-commands@^1.2.0",
+        "scope": null,
+        "escapedName": "redis-commands",
+        "name": "redis-commands",
+        "rawSpec": "^1.2.0",
+        "spec": ">=1.2.0 <2.0.0",
+        "type": "range"
+      },
+      "/Users/fzy/project/koa2_Sequelize_project/node_modules/redis"
+    ]
+  ],
+  "_from": "redis-commands@>=1.2.0 <2.0.0",
+  "_id": "redis-commands@1.3.1",
+  "_inCache": true,
+  "_location": "/redis-commands",
+  "_nodeVersion": "7.4.0",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/redis-commands-1.3.1.tgz_1485363355063_0.7909097610972822"
+  },
+  "_npmUser": {
+    "name": "bridgear",
+    "email": "ruben@bridgewater.de"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "redis-commands@^1.2.0",
+    "scope": null,
+    "escapedName": "redis-commands",
+    "name": "redis-commands",
+    "rawSpec": "^1.2.0",
+    "spec": ">=1.2.0 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/redis"
+  ],
+  "_resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.3.1.tgz",
+  "_shasum": "81d826f45fa9c8b2011f4cd7a0fe597d241d442b",
+  "_shrinkwrap": null,
+  "_spec": "redis-commands@^1.2.0",
+  "_where": "/Users/fzy/project/koa2_Sequelize_project/node_modules/redis",
+  "author": {
+    "name": "luin",
+    "email": "i@zihua.li",
+    "url": "http://zihua.li"
+  },
+  "bugs": {
+    "url": "https://github.com/NodeRedis/redis-commonds/issues"
+  },
+  "dependencies": {},
+  "description": "Redis commands",
+  "devDependencies": {
+    "chai": "^3.4.0",
+    "codeclimate-test-reporter": "^0.4.0",
+    "ioredis": "^2.0.0",
+    "istanbul": "^0.4.3",
+    "json-stable-stringify": "^1.0.0",
+    "mocha": "^3.0.0",
+    "snazzy": "^6.0.0",
+    "standard": "^8.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "81d826f45fa9c8b2011f4cd7a0fe597d241d442b",
+    "tarball": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.3.1.tgz"
+  },
+  "gitHead": "3c87f94d94fcf66ca0c77101a6d36fad32134326",
+  "homepage": "https://github.com/NodeRedis/redis-commonds",
+  "keywords": [
+    "redis",
+    "commands",
+    "prefix"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "bridgear",
+      "email": "ruben@bridgewater.de"
+    },
+    {
+      "name": "luin",
+      "email": "i@zihua.li"
+    }
+  ],
+  "name": "redis-commands",
+  "optionalDependencies": {},
+  "readme": "# Redis Commands\n\n[![Build Status](https://travis-ci.org/NodeRedis/redis-commands.png?branch=master)](https://travis-ci.org/NodeRedis/redis-commands)\n[![Code Climate](https://codeclimate.com/github/NodeRedis/redis-commands/badges/gpa.svg)](https://codeclimate.com/github/NodeRedis/redis-commands)\n[![Test Coverage](https://codeclimate.com/github/NodeRedis/redis-commands/badges/coverage.svg)](https://codeclimate.com/github/NodeRedis/redis-commands/coverage)\n\nThis module exports all the commands that Redis supports.\n\n## Install\n\n```shell\n$ npm install redis-commands\n```\n\n## Usage\n\n```javascript\nvar commands = require('redis-commands');\n```\n\n`.list` is an array contains all the lowercased commands:\n\n```javascript\ncommands.list.forEach(function (command) {\n  console.log(command);\n});\n```\n\n`.exists()` is used to check if the command exists:\n\n```javascript\ncommands.exists('set') // true\ncommands.exists('other-command') // false\n```\n\n`.hasFlag()` is used to check if the command has the flag:\n\n```javascript\ncommands.hasFlag('set', 'readonly') // false\n```\n\n`.getKeyIndexes()` is used to get the indexes of keys in the command arguments:\n\n```javascript\ncommands.getKeyIndexes('set', ['key', 'value']) // [0]\ncommands.getKeyIndexes('mget', ['key1', 'key2']) // [0, 1]\n```\n\n## Acknowledgment\n\nThank [@Yuan Chuan](https://github.com/yuanchuan) for the package name. The original redis-commands is renamed to [@yuanchuan/redis-commands](https://www.npmjs.com/package/@yuanchuan/redis-commands).\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/NodeRedis/redis-commands.git"
+  },
+  "scripts": {
+    "build": "node tools/build",
+    "coverage": "node ./node_modules/istanbul/lib/cli.js cover --preserve-comments ./node_modules/mocha/bin/_mocha -- -R spec",
+    "coverage:check": "node ./node_modules/istanbul/lib/cli.js check-coverage --branch 100 --statement 100",
+    "lint": "standard --fix --verbose | snazzy",
+    "posttest": "npm run coverage && npm run coverage:check",
+    "pretest": "npm run lint",
+    "test": "mocha"
+  },
+  "version": "1.3.1"
+}
diff --git a/node_modules/redis-commands/test/index.js b/node_modules/redis-commands/test/index.js
new file mode 100644
index 0000000..4bf73bd
--- /dev/null
+++ b/node_modules/redis-commands/test/index.js
@@ -0,0 +1,120 @@
+'use strict'
+
+/* global describe, it */
+
+var commands = require('..')
+var expect = require('chai').expect
+
+describe('redis-commands', function () {
+  describe('.list', function () {
+    it('should be an array', function () {
+      expect(commands.list).to.be.instanceof(Array)
+    })
+
+    it('should ensure every command is lowercase', function () {
+      commands.list.forEach(function (command) {
+        expect(command.toLowerCase()).to.eql(command)
+      })
+    })
+
+    it('should ensure quit command is added to the commands list', function () {
+      expect(commands.list.indexOf('quit')).not.to.eql(-1)
+    })
+
+    it('should not contain multi-word commands', function () {
+      commands.list.forEach(function (command) {
+        expect(command.indexOf(' ')).to.eql(-1)
+      })
+    })
+  })
+
+  describe('.exists()', function () {
+    it('should return true for existing commands', function () {
+      expect(commands.exists('set')).to.eql(true)
+      expect(commands.exists('get')).to.eql(true)
+      expect(commands.exists('cluster')).to.eql(true)
+      expect(commands.exists('quit')).to.eql(true)
+      expect(commands.exists('config')).to.eql(true)
+    })
+
+    it('should return false for non-existing commands', function () {
+      expect(commands.exists('SET')).to.eql(false)
+      expect(commands.exists('set get')).to.eql(false)
+      expect(commands.exists('other-command')).to.eql(false)
+    })
+  })
+
+  describe('.hasFlag()', function () {
+    it('should return true if the command has the flag', function () {
+      expect(commands.hasFlag('set', 'write')).to.eql(true)
+      expect(commands.hasFlag('set', 'denyoom')).to.eql(true)
+      expect(commands.hasFlag('select', 'fast')).to.eql(true)
+    })
+
+    it('should return false otherwise', function () {
+      expect(commands.hasFlag('set', 'fast')).to.eql(false)
+      expect(commands.hasFlag('set', 'readonly')).to.eql(false)
+      expect(commands.hasFlag('select', 'denyoom')).to.eql(false)
+      expect(commands.hasFlag('quit', 'denyoom')).to.eql(false)
+    })
+
+    it('should throw on unknown commands', function () {
+      expect(function () { commands.hasFlag('UNKNOWN') }).to.throw(Error)
+    })
+  })
+
+  describe('.getKeyIndexes()', function () {
+    var index = commands.getKeyIndexes
+
+    it('should throw on unknown commands', function () {
+      expect(function () { index('UNKNOWN') }).to.throw(Error)
+    })
+
+    it('should throw on faulty args', function () {
+      expect(function () { index('get', 'foo') }).to.throw(Error)
+    })
+
+    it('should return an empty array if no keys exist', function () {
+      expect(index('auth', [])).to.eql([])
+    })
+
+    it('should return key indexes', function () {
+      expect(index('set', ['foo', 'bar'])).to.eql([0])
+      expect(index('del', ['foo'])).to.eql([0])
+      expect(index('get', ['foo'])).to.eql([0])
+      expect(index('mget', ['foo', 'bar'])).to.eql([0, 1])
+      expect(index('mset', ['foo', 'v1', 'bar', 'v2'])).to.eql([0, 2])
+      expect(index('hmset', ['key', 'foo', 'v1', 'bar', 'v2'])).to.eql([0])
+      expect(index('blpop', ['key1', 'key2', '17'])).to.eql([0, 1])
+      expect(index('evalsha', ['23123', '2', 'foo', 'bar', 'zoo'])).to.eql([2, 3])
+      expect(index('sort', ['key'])).to.eql([0])
+      expect(index('zunionstore', ['out', '2', 'zset1', 'zset2', 'WEIGHTS', '2', '3'])).to.eql([0, 2, 3])
+      expect(index('migrate', ['127.0.0.1', 6379, 'foo', 0, 0, 'COPY'])).to.eql([2])
+      expect(index('migrate', ['127.0.0.1', 6379, '', 0, 0, 'REPLACE', 'KEYS', 'foo', 'bar'])).to.eql([7, 8])
+      expect(index('migrate', ['127.0.0.1', 6379, '', 0, 0, 'KEYS', 'foo', 'bar'])).to.eql([6, 7])
+    })
+
+    it('should support numeric argument', function () {
+      expect(index('evalsha', ['23123', 2, 'foo', 'bar', 'zoo'])).to.eql([2, 3])
+      expect(index('zinterstore', ['out', 2, 'zset1', 'zset2', 'WEIGHTS', 2, 3])).to.eql([0, 2, 3])
+    })
+
+    describe('disable parseExternalKey', function () {
+      it('should not parse external keys', function () {
+        expect(index('sort', ['key', 'BY', 'hash:*->field'])).to.eql([0, 2])
+        expect(index('sort', ['key', 'BY', 'hash:*->field', 'LIMIT', 2, 3, 'GET', 'gk', 'GET', '#', 'Get', 'gh->f*', 'DESC', 'ALPHA', 'STORE', 'store'])).to.eql([0, 2, 7, 11, 15])
+      })
+    })
+
+    describe('enable parseExternalKey', function () {
+      it('should parse external keys', function () {
+        expect(index('sort', ['key', 'BY', 'hash:*->field'], {
+          parseExternalKey: true
+        })).to.eql([0, [2, 6]])
+        expect(index('sort', ['key', 'BY', 'hash:*->field', 'LIMIT', 2, 3, 'GET', new Buffer('gk'), 'GET', '#', 'Get', 'gh->f*', 'DESC', 'ALPHA', 'STORE', 'store'], {
+          parseExternalKey: true
+        })).to.eql([0, [2, 6], [7, 2], [11, 2], 15])
+      })
+    })
+  })
+})
diff --git a/node_modules/redis-commands/tools/build.js b/node_modules/redis-commands/tools/build.js
new file mode 100644
index 0000000..4228f7f
--- /dev/null
+++ b/node_modules/redis-commands/tools/build.js
@@ -0,0 +1,62 @@
+var fs = require('fs')
+var path = require('path')
+var stringify = require('json-stable-stringify')
+var commandPath = path.join(__dirname, '..', 'commands.json')
+var redisCommands = require('../')
+
+var Redis = require('ioredis')
+var redis = new Redis(process.env.REDIS_URI)
+
+redis.command().then(function (res) {
+  redis.disconnect()
+
+  // Find all special handled cases
+  var movableKeys = String(redisCommands.getKeyIndexes).match(/case '[a-z-]+':/g).map(function (entry) {
+    return entry.replace(/^case '|':$/g, '')
+  })
+
+  var commands = res.reduce(function (prev, current) {
+    var currentCommandPos = movableKeys.indexOf(current[0])
+    if (currentCommandPos !== -1 && current[2].indexOf('movablekeys') !== -1) {
+      movableKeys.splice(currentCommandPos, 1)
+    }
+    // https://github.com/antirez/redis/issues/2598
+    if (current[0] === 'brpop' && current[4] === 1) {
+      current[4] = -2
+    }
+    prev[current[0]] = {
+      arity: current[1] || 1, // https://github.com/antirez/redis/pull/2986
+      flags: current[2],
+      keyStart: current[3],
+      keyStop: current[4],
+      step: current[5]
+    }
+    return prev
+  }, {})
+
+  // Future proof. Redis might implement this at some point
+  // https://github.com/antirez/redis/pull/2982
+  if (!commands.quit) {
+    commands.quit = {
+      arity: 1,
+      flags: [
+        'loading',
+        'stale',
+        'readonly'
+      ],
+      keyStart: 0,
+      keyStop: 0,
+      step: 0
+    }
+  }
+
+  if (movableKeys.length !== 0) {
+    throw new Error('Not all commands (\'' + movableKeys.join('\', \'') + '\') with the "movablekeys" flag are handled in the code')
+  }
+
+  // Use json-stable-stringify instead fo JSON.stringify
+  // for easier diffing
+  var content = stringify(commands, { space: '  ' })
+
+  fs.writeFile(commandPath, content)
+})
diff --git a/node_modules/redis-parser/.npmignore b/node_modules/redis-parser/.npmignore
new file mode 100644
index 0000000..af7d371
--- /dev/null
+++ b/node_modules/redis-parser/.npmignore
@@ -0,0 +1,15 @@
+# IntelliJ project files
+.idea
+*.iml
+out
+gen
+
+# Unrelevant files and folders
+benchmark
+coverage
+test
+.travis.yml
+.gitignore
+*.log
+.vscode
+.codeclimate.yml
\ No newline at end of file
diff --git a/node_modules/redis-parser/LICENSE b/node_modules/redis-parser/LICENSE
new file mode 100644
index 0000000..39d23f8
--- /dev/null
+++ b/node_modules/redis-parser/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 NodeRedis
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/node_modules/redis-parser/README.md b/node_modules/redis-parser/README.md
new file mode 100644
index 0000000..ff448f0
--- /dev/null
+++ b/node_modules/redis-parser/README.md
@@ -0,0 +1,163 @@
+[![Build Status](https://travis-ci.org/NodeRedis/node-redis-parser.png?branch=master)](https://travis-ci.org/NodeRedis/node-redis-parser)
+[![Test Coverage](https://codeclimate.com/github/NodeRedis/node-redis-parser/badges/coverage.svg)](https://codeclimate.com/github/NodeRedis/node-redis-parser/coverage)
+[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
+
+# redis-parser
+
+A high performance javascript redis parser built for [node_redis](https://github.com/NodeRedis/node_redis) and [ioredis](https://github.com/luin/ioredis). Parses all [RESP](http://redis.io/topics/protocol) data.
+
+## Install
+
+Install with [NPM](https://npmjs.org/):
+
+    npm install redis-parser
+
+## Usage
+
+```js
+var Parser = require('redis-parser');
+
+var myParser = new Parser(options);
+```
+
+### Options
+
+* `returnReply`: *function*; mandatory
+* `returnError`: *function*; mandatory
+* `returnFatalError`: *function*; optional, defaults to the returnError function
+* `returnBuffers`: *boolean*; optional, defaults to false
+* `stringNumbers`: *boolean*; optional, defaults to false
+
+### Functions
+
+* `reset()`: reset the parser to it's initial state
+* `setReturnBuffers(boolean)`: (JSParser only) set the returnBuffers option on/off without resetting the parser
+* `setStringNumbers(boolean)`: (JSParser only) set the stringNumbers option on/off without resetting the parser
+
+### Error classes
+
+* `RedisError` sub class of Error
+* `ReplyError` sub class of RedisError
+* `ParserError` sub class of RedisError
+
+All Redis errors will be returned as `ReplyErrors` while a parser error is returned as `ParserError`.  
+All error classes are exported by the parser.
+
+### Example
+
+```js
+var Parser = require("redis-parser");
+
+function Library () {}
+
+Library.prototype.returnReply = function (reply) { ... }
+Library.prototype.returnError = function (err) { ... }
+Library.prototype.returnFatalError = function (err) { ... }
+
+var lib = new Library();
+
+var parser = new Parser({
+    returnReply: function(reply) {
+        lib.returnReply(reply);
+    },
+    returnError: function(err) {
+        lib.returnError(err);
+    },
+    returnFatalError: function (err) {
+        lib.returnFatalError(err);
+    }
+});
+
+Library.prototype.streamHandler = function () {
+    this.stream.on('data', function (buffer) {
+        // Here the data (e.g. `new Buffer('$5\r\nHello\r\n'`)) is passed to the parser and the result is passed to either function depending on the provided data.
+        parser.execute(buffer);
+    });
+};
+```
+You do not have to use the returnFatalError function. Fatal errors will be returned in the normal error function in that case.
+
+And if you want to return buffers instead of strings, you can do this by adding the `returnBuffers` option.
+
+If you handle with big numbers that are to large for JS (Number.MAX_SAFE_INTEGER === 2^53 - 16) please use the `stringNumbers` option. That way all numbers are going to be returned as String and you can handle them safely.
+
+```js
+// Same functions as in the first example
+
+var parser = new Parser({
+    returnReply: function(reply) {
+        lib.returnReply(reply);
+    },
+    returnError: function(err) {
+        lib.returnError(err);
+    },
+    returnBuffers: true, // All strings are returned as Buffer e.g. <Buffer 48 65 6c 6c 6f>
+    stringNumbers: true // All numbers are returned as String
+});
+
+// The streamHandler as above
+```
+
+## Protocol errors
+
+To handle protocol errors (this is very unlikely to happen) gracefully you should add the returnFatalError option, reject any still running command (they might have been processed properly but the reply is just wrong), destroy the socket and reconnect. Note that while doing this no new command may be added, so all new commands have to be buffered in the meantime, otherwise a chunk might still contain partial data of a following command that was already processed properly but answered in the same chunk as the command that resulted in the protocol error.
+
+## Contribute
+
+The parser is highly optimized but there may still be further optimizations possible.
+
+    npm install
+    npm test
+    npm run benchmark
+
+Currently the benchmark compares the performance against the hiredis parser:
+
+    HIREDIS: $ multiple chunks in a bulk string x 859,880 ops/sec ±1.22% (82 runs sampled)
+    HIREDIS BUF: $ multiple chunks in a bulk string x 608,869 ops/sec ±1.72% (85 runs sampled)
+    JS PARSER: $ multiple chunks in a bulk string x 910,590 ops/sec ±0.87% (89 runs sampled)
+    JS PARSER BUF: $ multiple chunks in a bulk string x 1,299,507 ops/sec ±2.18% (84 runs sampled)
+
+    HIREDIS: + multiple chunks in a string x 1,787,203 ops/sec ±0.58% (96 runs sampled)
+    HIREDIS BUF: + multiple chunks in a string x 943,584 ops/sec ±1.62% (87 runs sampled)
+    JS PARSER: + multiple chunks in a string x 2,008,264 ops/sec ±1.01% (91 runs sampled)
+    JS PARSER BUF: + multiple chunks in a string x 2,045,546 ops/sec ±0.78% (91 runs sampled)
+
+    HIREDIS: $ 4mb bulk string x 310 ops/sec ±1.58% (75 runs sampled)
+    HIREDIS BUF: $ 4mb bulk string x 471 ops/sec ±2.28% (78 runs sampled)
+    JS PARSER: $ 4mb bulk string x 747 ops/sec ±2.43% (85 runs sampled)
+    JS PARSER BUF: $ 4mb bulk string x 846 ops/sec ±5.52% (72 runs sampled)
+
+    HIREDIS: + simple string x 2,324,866 ops/sec ±1.61% (90 runs sampled)
+    HIREDIS BUF: + simple string x 1,085,823 ops/sec ±2.47% (82 runs sampled)
+    JS PARSER: + simple string x 4,567,358 ops/sec ±1.97% (81 runs sampled)
+    JS PARSER BUF: + simple string x 5,433,901 ops/sec ±0.66% (93 runs sampled)
+
+    HIREDIS: : integer x 2,332,946 ops/sec ±0.47% (93 runs sampled)
+    JS PARSER: : integer x 17,730,449 ops/sec ±0.73% (91 runs sampled)
+    JS PARSER STR: : integer x 12,942,037 ops/sec ±0.51% (92 runs sampled)
+
+    HIREDIS: : big integer x 2,012,572 ops/sec ±0.33% (93 runs sampled)
+    JS PARSER: : big integer x 10,210,923 ops/sec ±0.94% (94 runs sampled)
+    JS PARSER STR: : big integer x 4,453,320 ops/sec ±0.52% (94 runs sampled)
+
+    HIREDIS: * array x 44,479 ops/sec ±0.55% (94 runs sampled)
+    HIREDIS BUF: * array x 14,391 ops/sec ±1.04% (86 runs sampled)
+    JS PARSER: * array x 53,796 ops/sec ±2.08% (79 runs sampled)
+    JS PARSER BUF: * array x 72,428 ops/sec ±0.72% (93 runs sampled)
+
+    HIREDIS: * big nested array x 217 ops/sec ±0.97% (83 runs sampled)
+    HIREDIS BUF: * big nested array x 255 ops/sec ±2.28% (77 runs sampled)
+    JS PARSER: * big nested array x 242 ops/sec ±1.10% (85 runs sampled)
+    JS PARSER BUF: * big nested array x 375 ops/sec ±1.21% (88 runs sampled)
+
+    HIREDIS: - error x 78,821 ops/sec ±0.80% (93 runs sampled)
+    JS PARSER: - error x 143,382 ops/sec ±0.75% (92 runs sampled)
+
+    Platform info:
+    Ubuntu 16.10
+    Node.js 7.4.0
+    Intel(R) Core(TM) i7-5600U CPU
+
+## License
+
+[MIT](./LICENSE)
diff --git a/node_modules/redis-parser/changelog.md b/node_modules/redis-parser/changelog.md
new file mode 100644
index 0000000..5cd9470
--- /dev/null
+++ b/node_modules/redis-parser/changelog.md
@@ -0,0 +1,138 @@
+## v.2.6.0 - 03 Apr, 2017
+
+Internals
+
+-  Use Buffer.allocUnsafe instead of new Buffer() with modern Node.js versions
+
+## v.2.5.0 - 11 Mar, 2017
+
+Features
+
+-  Added a `ParserError` class to differentiate them to ReplyErrors. The class is also exported
+
+Bugfixes
+
+-  All errors now show their error message again next to the error name in the stack trace
+-  ParserErrors now show the offset and buffer attributes while being logged
+
+## v.2.4.1 - 05 Feb, 2017
+
+Bugfixes
+
+-  Fixed minimal memory consumption overhead for chunked buffers
+
+## v.2.4.0 - 25 Jan, 2017
+
+Features
+
+-  Added `reset` function to reset the parser to it's initial values
+-  Added `setReturnBuffers` function to reset the returnBuffers option (Only for the JSParser)
+-  Added `setStringNumbers` function to reset the stringNumbers option (Only for the JSParser)
+-  All Errors are now of sub classes of the new `RedisError` class. It is also exported.
+-  Improved bulk string chunked data handling performance
+
+Bugfixes
+
+-  Parsing time for big nested arrays is now linear
+
+## v.2.3.0 - 25 Nov, 2016
+
+Features
+
+-  Parsing time for big arrays (e.g. 4mb+) is now linear and works well for arbitrary array sizes
+
+This case is a magnitude faster than before
+
+    OLD STR: * big array x 1.09 ops/sec ±2.15% (7 runs sampled)
+    OLD BUF: * big array x 1.23 ops/sec ±2.67% (8 runs sampled)
+
+    NEW STR: * big array x 273 ops/sec ±2.09% (85 runs sampled)
+    NEW BUF: * big array x 259 ops/sec ±1.32% (85 runs sampled)
+    (~10mb array with 1000 entries)
+
+## v.2.2.0 - 18 Nov, 2016
+
+Features
+
+-  Improve `stringNumbers` parsing performance by up to 100%
+
+Bugfixes
+
+-  Do not unref the interval anymore due to issues with NodeJS
+
+## v.2.1.1 - 31 Oct, 2016
+
+Bugfixes
+
+-  Remove erroneously added const to support Node.js 0.10
+
+## v.2.1.0 - 30 Oct, 2016
+
+Features
+
+-  Improve parser errors by adding more detailed information to them
+-  Accept manipulated Object.prototypes
+-  Unref the interval if used
+
+## v.2.0.4 - 21 Jul, 2016
+
+Bugfixes
+
+-  Fixed multi byte characters getting corrupted
+
+## v.2.0.3 - 17 Jun, 2016
+
+Bugfixes
+
+-  Fixed parser not working with huge buffers (e.g. 300 MB)
+
+## v.2.0.2 - 08 Jun, 2016
+
+Bugfixes
+
+-  Fixed parser with returnBuffers option returning corrupted data
+
+## v.2.0.1 - 04 Jun, 2016
+
+Bugfixes
+
+-  Fixed multiple parsers working concurrently resulting in faulty data in some cases
+
+## v.2.0.0 - 29 May, 2016
+
+The javascript parser got completely rewritten by [Michael Diarmid](https://github.com/Salakar) and [Ruben Bridgewater](https://github.com/BridgeAR) and is now a lot faster than the hiredis parser.
+Therefore the hiredis parser was deprecated and should only be used for testing purposes and benchmarking comparison.
+
+All Errors returned by the parser are from now on of class ReplyError
+
+Features
+
+-  Improved performance by up to 15x as fast as before
+-  Improved options validation
+-  Added ReplyError Class
+-  Added parser benchmark
+-  Switched default parser from hiredis to JS, no matter if hiredis is installed or not
+
+Removed
+
+-  Deprecated hiredis support
+
+## v.1.3.0 - 27 Mar, 2016
+
+Features
+
+-  Added `auto` as parser name option to check what parser is available
+-  Non existing requested parsers falls back into auto mode instead of always choosing the JS parser
+
+## v.1.2.0 - 27 Mar, 2016
+
+Features
+
+-  Added `stringNumbers` option to make sure all numbers are returned as string instead of a js number for precision
+-  The parser is from now on going to print warnings if a parser is explicitly requested that does not exist and gracefully chooses the JS parser
+
+## v.1.1.0 - 26 Jan, 2016
+
+Features
+
+-  The parser is from now on going to reset itself on protocol errors
diff --git a/node_modules/redis-parser/index.js b/node_modules/redis-parser/index.js
new file mode 100644
index 0000000..a0c777d
--- /dev/null
+++ b/node_modules/redis-parser/index.js
@@ -0,0 +1,6 @@
+'use strict'
+
+module.exports = require('./lib/parser')
+module.exports.ReplyError = require('./lib/replyError')
+module.exports.RedisError = require('./lib/redisError')
+module.exports.ParserError = require('./lib/redisError')
diff --git a/node_modules/redis-parser/lib/hiredis.js b/node_modules/redis-parser/lib/hiredis.js
new file mode 100644
index 0000000..0f94fbe
--- /dev/null
+++ b/node_modules/redis-parser/lib/hiredis.js
@@ -0,0 +1,62 @@
+'use strict'
+
+var hiredis = require('hiredis')
+var ReplyError = require('../lib/replyError')
+var ParserError = require('../lib/parserError')
+
+/**
+ * Parse data
+ * @param parser
+ * @returns {*}
+ */
+function parseData (parser, data) {
+  try {
+    return parser.reader.get()
+  } catch (err) {
+    // Protocol errors land here
+    // Reset the parser. Otherwise new commands can't be processed properly
+    parser.reader = new hiredis.Reader(parser.options)
+    parser.returnFatalError(new ParserError(err.message, JSON.stringify(data), -1))
+  }
+}
+
+/**
+ * Hiredis Parser
+ * @param options
+ * @constructor
+ */
+function HiredisReplyParser (options) {
+  this.returnError = options.returnError
+  this.returnFatalError = options.returnFatalError || options.returnError
+  this.returnReply = options.returnReply
+  this.name = 'hiredis'
+  this.options = {
+    return_buffers: !!options.returnBuffers
+  }
+  this.reader = new hiredis.Reader(this.options)
+}
+
+HiredisReplyParser.prototype.execute = function (data) {
+  this.reader.feed(data)
+  var reply = parseData(this, data)
+
+  while (reply !== undefined) {
+    if (reply && reply.name === 'Error') {
+      this.returnError(new ReplyError(reply.message))
+    } else {
+      this.returnReply(reply)
+    }
+    reply = parseData(this, data)
+  }
+}
+
+/**
+ * Reset the parser values to the initial state
+ *
+ * @returns {undefined}
+ */
+HiredisReplyParser.prototype.reset = function () {
+  this.reader = new hiredis.Reader(this.options)
+}
+
+module.exports = HiredisReplyParser
diff --git a/node_modules/redis-parser/lib/parser.js b/node_modules/redis-parser/lib/parser.js
new file mode 100644
index 0000000..4ba6a18
--- /dev/null
+++ b/node_modules/redis-parser/lib/parser.js
@@ -0,0 +1,581 @@
+'use strict'
+
+var StringDecoder = require('string_decoder').StringDecoder
+var decoder = new StringDecoder()
+var ReplyError = require('./replyError')
+var ParserError = require('./parserError')
+var bufferPool = bufferAlloc(32 * 1024)
+var bufferOffset = 0
+var interval = null
+var counter = 0
+var notDecreased = 0
+var isModern = typeof Buffer.allocUnsafe === 'function'
+
+/**
+ * For backwards compatibility
+ * @param len
+ * @returns {Buffer}
+ */
+
+function bufferAlloc (len) {
+  return isModern ? Buffer.allocUnsafe(len) : new Buffer(len)
+}
+
+/**
+ * Used for lengths and numbers only, faster perf on arrays / bulks
+ * @param parser
+ * @returns {*}
+ */
+function parseSimpleNumbers (parser) {
+  var offset = parser.offset
+  var length = parser.buffer.length - 1
+  var number = 0
+  var sign = 1
+
+  if (parser.buffer[offset] === 45) {
+    sign = -1
+    offset++
+  }
+
+  while (offset < length) {
+    var c1 = parser.buffer[offset++]
+    if (c1 === 13) { // \r\n
+      parser.offset = offset + 1
+      return sign * number
+    }
+    number = (number * 10) + (c1 - 48)
+  }
+}
+
+/**
+ * Used for integer numbers in case of the returnNumbers option
+ *
+ * The maximimum possible integer to use is: Math.floor(Number.MAX_SAFE_INTEGER / 10)
+ * Staying in a SMI Math.floor((Math.pow(2, 32) / 10) - 1) is even more efficient though
+ *
+ * @param parser
+ * @returns {*}
+ */
+function parseStringNumbers (parser) {
+  var offset = parser.offset
+  var length = parser.buffer.length - 1
+  var number = 0
+  var res = ''
+
+  if (parser.buffer[offset] === 45) {
+    res += '-'
+    offset++
+  }
+
+  while (offset < length) {
+    var c1 = parser.buffer[offset++]
+    if (c1 === 13) { // \r\n
+      parser.offset = offset + 1
+      if (number !== 0) {
+        res += number
+      }
+      return res
+    } else if (number > 429496728) {
+      res += (number * 10) + (c1 - 48)
+      number = 0
+    } else if (c1 === 48 && number === 0) {
+      res += 0
+    } else {
+      number = (number * 10) + (c1 - 48)
+    }
+  }
+}
+
+/**
+ * Returns a string or buffer of the provided offset start and
+ * end ranges. Checks `optionReturnBuffers`.
+ *
+ * If returnBuffers is active, all return values are returned as buffers besides numbers and errors
+ *
+ * @param parser
+ * @param start
+ * @param end
+ * @returns {*}
+ */
+function convertBufferRange (parser, start, end) {
+  parser.offset = end + 2
+  if (parser.optionReturnBuffers === true) {
+    return parser.buffer.slice(start, end)
+  }
+
+  return parser.buffer.toString('utf-8', start, end)
+}
+
+/**
+ * Parse a '+' redis simple string response but forward the offsets
+ * onto convertBufferRange to generate a string.
+ * @param parser
+ * @returns {*}
+ */
+function parseSimpleString (parser) {
+  var start = parser.offset
+  var offset = start
+  var buffer = parser.buffer
+  var length = buffer.length - 1
+
+  while (offset < length) {
+    if (buffer[offset++] === 13) { // \r\n
+      return convertBufferRange(parser, start, offset - 1)
+    }
+  }
+}
+
+/**
+ * Returns the string length via parseSimpleNumbers
+ * @param parser
+ * @returns {*}
+ */
+function parseLength (parser) {
+  var string = parseSimpleNumbers(parser)
+  if (string !== undefined) {
+    return string
+  }
+}
+
+/**
+ * Parse a ':' redis integer response
+ *
+ * If stringNumbers is activated the parser always returns numbers as string
+ * This is important for big numbers (number > Math.pow(2, 53)) as js numbers
+ * are 64bit floating point numbers with reduced precision
+ *
+ * @param parser
+ * @returns {*}
+ */
+function parseInteger (parser) {
+  if (parser.optionStringNumbers) {
+    return parseStringNumbers(parser)
+  }
+  return parseSimpleNumbers(parser)
+}
+
+/**
+ * Parse a '$' redis bulk string response
+ * @param parser
+ * @returns {*}
+ */
+function parseBulkString (parser) {
+  var length = parseLength(parser)
+  if (length === undefined) {
+    return
+  }
+  if (length === -1) {
+    return null
+  }
+  var offsetEnd = parser.offset + length
+  if (offsetEnd + 2 > parser.buffer.length) {
+    parser.bigStrSize = offsetEnd + 2
+    parser.bigOffset = parser.offset
+    parser.totalChunkSize = parser.buffer.length
+    parser.bufferCache.push(parser.buffer)
+    return
+  }
+
+  return convertBufferRange(parser, parser.offset, offsetEnd)
+}
+
+/**
+ * Parse a '-' redis error response
+ * @param parser
+ * @returns {Error}
+ */
+function parseError (parser) {
+  var string = parseSimpleString(parser)
+  if (string !== undefined) {
+    if (parser.optionReturnBuffers === true) {
+      string = string.toString()
+    }
+    return new ReplyError(string)
+  }
+}
+
+/**
+ * Parsing error handler, resets parser buffer
+ * @param parser
+ * @param error
+ */
+function handleError (parser, error) {
+  parser.buffer = null
+  parser.returnFatalError(error)
+}
+
+/**
+ * Parse a '*' redis array response
+ * @param parser
+ * @returns {*}
+ */
+function parseArray (parser) {
+  var length = parseLength(parser)
+  if (length === undefined) {
+    return
+  }
+  if (length === -1) {
+    return null
+  }
+  var responses = new Array(length)
+  return parseArrayElements(parser, responses, 0)
+}
+
+/**
+ * Push a partly parsed array to the stack
+ *
+ * @param parser
+ * @param elem
+ * @param i
+ * @returns {undefined}
+ */
+function pushArrayCache (parser, elem, pos) {
+  parser.arrayCache.push(elem)
+  parser.arrayPos.push(pos)
+}
+
+/**
+ * Parse chunked redis array response
+ * @param parser
+ * @returns {*}
+ */
+function parseArrayChunks (parser) {
+  var tmp = parser.arrayCache.pop()
+  var pos = parser.arrayPos.pop()
+  if (parser.arrayCache.length) {
+    var res = parseArrayChunks(parser)
+    if (!res) {
+      pushArrayCache(parser, tmp, pos)
+      return
+    }
+    tmp[pos++] = res
+  }
+  return parseArrayElements(parser, tmp, pos)
+}
+
+/**
+ * Parse redis array response elements
+ * @param parser
+ * @param responses
+ * @param i
+ * @returns {*}
+ */
+function parseArrayElements (parser, responses, i) {
+  var bufferLength = parser.buffer.length
+  while (i < responses.length) {
+    var offset = parser.offset
+    if (parser.offset >= bufferLength) {
+      pushArrayCache(parser, responses, i)
+      return
+    }
+    var response = parseType(parser, parser.buffer[parser.offset++])
+    if (response === undefined) {
+      if (!parser.arrayCache.length) {
+        parser.offset = offset
+      }
+      pushArrayCache(parser, responses, i)
+      return
+    }
+    responses[i] = response
+    i++
+  }
+
+  return responses
+}
+
+/**
+ * Called the appropriate parser for the specified type.
+ * @param parser
+ * @param type
+ * @returns {*}
+ */
+function parseType (parser, type) {
+  switch (type) {
+    case 36: // $
+      return parseBulkString(parser)
+    case 58: // :
+      return parseInteger(parser)
+    case 43: // +
+      return parseSimpleString(parser)
+    case 42: // *
+      return parseArray(parser)
+    case 45: // -
+      return parseError(parser)
+    default:
+      return handleError(parser, new ParserError(
+        'Protocol error, got ' + JSON.stringify(String.fromCharCode(type)) + ' as reply type byte',
+        JSON.stringify(parser.buffer),
+        parser.offset
+      ))
+  }
+}
+
+// All allowed options including their typeof value
+var optionTypes = {
+  returnError: 'function',
+  returnFatalError: 'function',
+  returnReply: 'function',
+  returnBuffers: 'boolean',
+  stringNumbers: 'boolean',
+  name: 'string'
+}
+
+/**
+ * Javascript Redis Parser
+ * @param options
+ * @constructor
+ */
+function JavascriptRedisParser (options) {
+  if (!(this instanceof JavascriptRedisParser)) {
+    return new JavascriptRedisParser(options)
+  }
+  if (!options || !options.returnError || !options.returnReply) {
+    throw new TypeError('Please provide all return functions while initiating the parser')
+  }
+  for (var key in options) {
+    // eslint-disable-next-line valid-typeof
+    if (optionTypes.hasOwnProperty(key) && typeof options[key] !== optionTypes[key]) {
+      throw new TypeError('The options argument contains the property "' + key + '" that is either unknown or of a wrong type')
+    }
+  }
+  if (options.name === 'hiredis') {
+    /* istanbul ignore next: hiredis is only supported for legacy usage */
+    try {
+      var Hiredis = require('./hiredis')
+      console.error(new TypeError('Using hiredis is discouraged. Please use the faster JS parser by removing the name option.').stack.replace('Error', 'Warning'))
+      return new Hiredis(options)
+    } catch (e) {
+      console.error(new TypeError('Hiredis is not installed. Please remove the `name` option. The (faster) JS parser is used instead.').stack.replace('Error', 'Warning'))
+    }
+  }
+  this.optionReturnBuffers = !!options.returnBuffers
+  this.optionStringNumbers = !!options.stringNumbers
+  this.returnError = options.returnError
+  this.returnFatalError = options.returnFatalError || options.returnError
+  this.returnReply = options.returnReply
+  this.name = 'javascript'
+  this.reset()
+}
+
+/**
+ * Reset the parser values to the initial state
+ *
+ * @returns {undefined}
+ */
+JavascriptRedisParser.prototype.reset = function () {
+  this.offset = 0
+  this.buffer = null
+  this.bigStrSize = 0
+  this.bigOffset = 0
+  this.totalChunkSize = 0
+  this.bufferCache = []
+  this.arrayCache = []
+  this.arrayPos = []
+}
+
+/**
+ * Set the returnBuffers option
+ *
+ * @param returnBuffers
+ * @returns {undefined}
+ */
+JavascriptRedisParser.prototype.setReturnBuffers = function (returnBuffers) {
+  if (typeof returnBuffers !== 'boolean') {
+    throw new TypeError('The returnBuffers argument has to be a boolean')
+  }
+  this.optionReturnBuffers = returnBuffers
+}
+
+/**
+ * Set the stringNumbers option
+ *
+ * @param stringNumbers
+ * @returns {undefined}
+ */
+JavascriptRedisParser.prototype.setStringNumbers = function (stringNumbers) {
+  if (typeof stringNumbers !== 'boolean') {
+    throw new TypeError('The stringNumbers argument has to be a boolean')
+  }
+  this.optionStringNumbers = stringNumbers
+}
+
+/**
+ * Decrease the bufferPool size over time
+ * @returns {undefined}
+ */
+function decreaseBufferPool () {
+  if (bufferPool.length > 50 * 1024) {
+    // Balance between increasing and decreasing the bufferPool
+    if (counter === 1 || notDecreased > counter * 2) {
+      // Decrease the bufferPool by 10% by removing the first 10% of the current pool
+      var sliceLength = Math.floor(bufferPool.length / 10)
+      if (bufferOffset <= sliceLength) {
+        bufferOffset = 0
+      } else {
+        bufferOffset -= sliceLength
+      }
+      bufferPool = bufferPool.slice(sliceLength, bufferPool.length)
+    } else {
+      notDecreased++
+      counter--
+    }
+  } else {
+    clearInterval(interval)
+    counter = 0
+    notDecreased = 0
+    interval = null
+  }
+}
+
+/**
+ * Check if the requested size fits in the current bufferPool.
+ * If it does not, reset and increase the bufferPool accordingly.
+ *
+ * @param length
+ * @returns {undefined}
+ */
+function resizeBuffer (length) {
+  if (bufferPool.length < length + bufferOffset) {
+    var multiplier = length > 1024 * 1024 * 75 ? 2 : 3
+    if (bufferOffset > 1024 * 1024 * 111) {
+      bufferOffset = 1024 * 1024 * 50
+    }
+    bufferPool = bufferAlloc(length * multiplier + bufferOffset)
+    bufferOffset = 0
+    counter++
+    if (interval === null) {
+      interval = setInterval(decreaseBufferPool, 50)
+    }
+  }
+}
+
+/**
+ * Concat a bulk string containing multiple chunks
+ *
+ * Notes:
+ * 1) The first chunk might contain the whole bulk string including the \r
+ * 2) We are only safe to fully add up elements that are neither the first nor any of the last two elements
+ *
+ * @param parser
+ * @returns {String}
+ */
+function concatBulkString (parser) {
+  var list = parser.bufferCache
+  var chunks = list.length
+  var offset = parser.bigStrSize - parser.totalChunkSize
+  parser.offset = offset
+  if (offset <= 2) {
+    if (chunks === 2) {
+      return list[0].toString('utf8', parser.bigOffset, list[0].length + offset - 2)
+    }
+    chunks--
+    offset = list[list.length - 2].length + offset
+  }
+  var res = decoder.write(list[0].slice(parser.bigOffset))
+  for (var i = 1; i < chunks - 1; i++) {
+    res += decoder.write(list[i])
+  }
+  res += decoder.end(list[i].slice(0, offset - 2))
+  return res
+}
+
+/**
+ * Concat the collected chunks from parser.bufferCache.
+ *
+ * Increases the bufferPool size beforehand if necessary.
+ *
+ * @param parser
+ * @returns {Buffer}
+ */
+function concatBulkBuffer (parser) {
+  var list = parser.bufferCache
+  var chunks = list.length
+  var length = parser.bigStrSize - parser.bigOffset - 2
+  var offset = parser.bigStrSize - parser.totalChunkSize
+  parser.offset = offset
+  if (offset <= 2) {
+    if (chunks === 2) {
+      return list[0].slice(parser.bigOffset, list[0].length + offset - 2)
+    }
+    chunks--
+    offset = list[list.length - 2].length + offset
+  }
+  resizeBuffer(length)
+  var start = bufferOffset
+  list[0].copy(bufferPool, start, parser.bigOffset, list[0].length)
+  bufferOffset += list[0].length - parser.bigOffset
+  for (var i = 1; i < chunks - 1; i++) {
+    list[i].copy(bufferPool, bufferOffset)
+    bufferOffset += list[i].length
+  }
+  list[i].copy(bufferPool, bufferOffset, 0, offset - 2)
+  bufferOffset += offset - 2
+  return bufferPool.slice(start, bufferOffset)
+}
+
+/**
+ * Parse the redis buffer
+ * @param buffer
+ * @returns {undefined}
+ */
+JavascriptRedisParser.prototype.execute = function execute (buffer) {
+  if (this.buffer === null) {
+    this.buffer = buffer
+    this.offset = 0
+  } else if (this.bigStrSize === 0) {
+    var oldLength = this.buffer.length
+    var remainingLength = oldLength - this.offset
+    var newBuffer = bufferAlloc(remainingLength + buffer.length)
+    this.buffer.copy(newBuffer, 0, this.offset, oldLength)
+    buffer.copy(newBuffer, remainingLength, 0, buffer.length)
+    this.buffer = newBuffer
+    this.offset = 0
+    if (this.arrayCache.length) {
+      var arr = parseArrayChunks(this)
+      if (!arr) {
+        return
+      }
+      this.returnReply(arr)
+    }
+  } else if (this.totalChunkSize + buffer.length >= this.bigStrSize) {
+    this.bufferCache.push(buffer)
+    var tmp = this.optionReturnBuffers ? concatBulkBuffer(this) : concatBulkString(this)
+    this.bigStrSize = 0
+    this.bufferCache = []
+    this.buffer = buffer
+    if (this.arrayCache.length) {
+      this.arrayCache[0][this.arrayPos[0]++] = tmp
+      tmp = parseArrayChunks(this)
+      if (!tmp) {
+        return
+      }
+    }
+    this.returnReply(tmp)
+  } else {
+    this.bufferCache.push(buffer)
+    this.totalChunkSize += buffer.length
+    return
+  }
+
+  while (this.offset < this.buffer.length) {
+    var offset = this.offset
+    var type = this.buffer[this.offset++]
+    var response = parseType(this, type)
+    if (response === undefined) {
+      if (!this.arrayCache.length) {
+        this.offset = offset
+      }
+      return
+    }
+
+    if (type === 45) {
+      this.returnError(response)
+    } else {
+      this.returnReply(response)
+    }
+  }
+
+  this.buffer = null
+}
+
+module.exports = JavascriptRedisParser
diff --git a/node_modules/redis-parser/lib/parserError.js b/node_modules/redis-parser/lib/parserError.js
new file mode 100644
index 0000000..883e554
--- /dev/null
+++ b/node_modules/redis-parser/lib/parserError.js
@@ -0,0 +1,25 @@
+'use strict'
+
+var util = require('util')
+var assert = require('assert')
+var RedisError = require('./redisError')
+var ADD_STACKTRACE = false
+
+function ParserError (message, buffer, offset) {
+  assert(buffer)
+  assert.strictEqual(typeof offset, 'number')
+  RedisError.call(this, message, ADD_STACKTRACE)
+  this.offset = offset
+  this.buffer = buffer
+  Error.captureStackTrace(this, ParserError)
+}
+
+util.inherits(ParserError, RedisError)
+
+Object.defineProperty(ParserError.prototype, 'name', {
+  value: 'ParserError',
+  configurable: true,
+  writable: true
+})
+
+module.exports = ParserError
diff --git a/node_modules/redis-parser/lib/redisError.js b/node_modules/redis-parser/lib/redisError.js
new file mode 100644
index 0000000..374bbb7
--- /dev/null
+++ b/node_modules/redis-parser/lib/redisError.js
@@ -0,0 +1,24 @@
+'use strict'
+
+var util = require('util')
+
+function RedisError (message, stack) {
+  Object.defineProperty(this, 'message', {
+    value: message || '',
+    configurable: true,
+    writable: true
+  })
+  if (stack || stack === undefined) {
+    Error.captureStackTrace(this, RedisError)
+  }
+}
+
+util.inherits(RedisError, Error)
+
+Object.defineProperty(RedisError.prototype, 'name', {
+  value: 'RedisError',
+  configurable: true,
+  writable: true
+})
+
+module.exports = RedisError
diff --git a/node_modules/redis-parser/lib/replyError.js b/node_modules/redis-parser/lib/replyError.js
new file mode 100644
index 0000000..080214e
--- /dev/null
+++ b/node_modules/redis-parser/lib/replyError.js
@@ -0,0 +1,23 @@
+'use strict'
+
+var util = require('util')
+var RedisError = require('./redisError')
+var ADD_STACKTRACE = false
+
+function ReplyError (message) {
+  var tmp = Error.stackTraceLimit
+  Error.stackTraceLimit = 2
+  RedisError.call(this, message, ADD_STACKTRACE)
+  Error.captureStackTrace(this, ReplyError)
+  Error.stackTraceLimit = tmp
+}
+
+util.inherits(ReplyError, RedisError)
+
+Object.defineProperty(ReplyError.prototype, 'name', {
+  value: 'ReplyError',
+  configurable: true,
+  writable: true
+})
+
+module.exports = ReplyError
diff --git a/node_modules/redis-parser/package.json b/node_modules/redis-parser/package.json
new file mode 100644
index 0000000..3d301e8
--- /dev/null
+++ b/node_modules/redis-parser/package.json
@@ -0,0 +1,114 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "redis-parser@^2.6.0",
+        "scope": null,
+        "escapedName": "redis-parser",
+        "name": "redis-parser",
+        "rawSpec": "^2.6.0",
+        "spec": ">=2.6.0 <3.0.0",
+        "type": "range"
+      },
+      "/Users/fzy/project/koa2_Sequelize_project/node_modules/redis"
+    ]
+  ],
+  "_from": "redis-parser@>=2.6.0 <3.0.0",
+  "_id": "redis-parser@2.6.0",
+  "_inCache": true,
+  "_location": "/redis-parser",
+  "_nodeVersion": "7.7.3",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/redis-parser-2.6.0.tgz_1491263124772_0.7531374620739371"
+  },
+  "_npmUser": {
+    "name": "bridgear",
+    "email": "ruben@bridgewater.de"
+  },
+  "_npmVersion": "4.1.2",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "redis-parser@^2.6.0",
+    "scope": null,
+    "escapedName": "redis-parser",
+    "name": "redis-parser",
+    "rawSpec": "^2.6.0",
+    "spec": ">=2.6.0 <3.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/redis"
+  ],
+  "_resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz",
+  "_shasum": "52ed09dacac108f1a631c07e9b69941e7a19504b",
+  "_shrinkwrap": null,
+  "_spec": "redis-parser@^2.6.0",
+  "_where": "/Users/fzy/project/koa2_Sequelize_project/node_modules/redis",
+  "author": {
+    "name": "Ruben Bridgewater"
+  },
+  "bugs": {
+    "url": "https://github.com/NodeRedis/node-redis-parser/issues"
+  },
+  "dependencies": {},
+  "description": "Javascript Redis protocol (RESP) parser",
+  "devDependencies": {
+    "benchmark": "^2.1.0",
+    "codeclimate-test-reporter": "^0.4.0",
+    "hiredis": "^0.5.0",
+    "intercept-stdout": "^0.1.2",
+    "istanbul": "^0.4.0",
+    "mocha": "^3.1.2",
+    "standard": "^9.0.0"
+  },
+  "directories": {
+    "test": "test",
+    "lib": "lib"
+  },
+  "dist": {
+    "shasum": "52ed09dacac108f1a631c07e9b69941e7a19504b",
+    "tarball": "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "gitHead": "eea04cad0c4f53fd1e9f7079b5f4ededf50f5945",
+  "homepage": "https://github.com/NodeRedis/node-redis-parser#readme",
+  "keywords": [
+    "redis",
+    "protocol",
+    "parser",
+    "database",
+    "javascript",
+    "node",
+    "nodejs",
+    "resp",
+    "hiredis"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "bridgear",
+      "email": "ruben@bridgewater.de"
+    }
+  ],
+  "name": "redis-parser",
+  "optionalDependencies": {},
+  "readme": "[![Build Status](https://travis-ci.org/NodeRedis/node-redis-parser.png?branch=master)](https://travis-ci.org/NodeRedis/node-redis-parser)\n[![Test Coverage](https://codeclimate.com/github/NodeRedis/node-redis-parser/badges/coverage.svg)](https://codeclimate.com/github/NodeRedis/node-redis-parser/coverage)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\n# redis-parser\n\nA high performance javascript redis parser built for [node_redis](https://github.com/NodeRedis/node_redis) and [ioredis](https://github.com/luin/ioredis). Parses all [RESP](http://redis.io/topics/protocol) data.\n\n## Install\n\nInstall with [NPM](https://npmjs.org/):\n\n    npm install redis-parser\n\n## Usage\n\n```js\nvar Parser = require('redis-parser');\n\nvar myParser = new Parser(options);\n```\n\n### Options\n\n* `returnReply`: *function*; mandatory\n* `returnError`: *function*; mandatory\n* `returnFatalError`: *function*; optional, defaults to the returnError function\n* `returnBuffers`: *boolean*; optional, defaults to false\n* `stringNumbers`: *boolean*; optional, defaults to false\n\n### Functions\n\n* `reset()`: reset the parser to it's initial state\n* `setReturnBuffers(boolean)`: (JSParser only) set the returnBuffers option on/off without resetting the parser\n* `setStringNumbers(boolean)`: (JSParser only) set the stringNumbers option on/off without resetting the parser\n\n### Error classes\n\n* `RedisError` sub class of Error\n* `ReplyError` sub class of RedisError\n* `ParserError` sub class of RedisError\n\nAll Redis errors will be returned as `ReplyErrors` while a parser error is returned as `ParserError`.  \nAll error classes are exported by the parser.\n\n### Example\n\n```js\nvar Parser = require(\"redis-parser\");\n\nfunction Library () {}\n\nLibrary.prototype.returnReply = function (reply) { ... }\nLibrary.prototype.returnError = function (err) { ... }\nLibrary.prototype.returnFatalError = function (err) { ... }\n\nvar lib = new Library();\n\nvar parser = new Parser({\n    returnReply: function(reply) {\n        lib.returnReply(reply);\n    },\n    returnError: function(err) {\n        lib.returnError(err);\n    },\n    returnFatalError: function (err) {\n        lib.returnFatalError(err);\n    }\n});\n\nLibrary.prototype.streamHandler = function () {\n    this.stream.on('data', function (buffer) {\n        // Here the data (e.g. `new Buffer('$5\\r\\nHello\\r\\n'`)) is passed to the parser and the result is passed to either function depending on the provided data.\n        parser.execute(buffer);\n    });\n};\n```\nYou do not have to use the returnFatalError function. Fatal errors will be returned in the normal error function in that case.\n\nAnd if you want to return buffers instead of strings, you can do this by adding the `returnBuffers` option.\n\nIf you handle with big numbers that are to large for JS (Number.MAX_SAFE_INTEGER === 2^53 - 16) please use the `stringNumbers` option. That way all numbers are going to be returned as String and you can handle them safely.\n\n```js\n// Same functions as in the first example\n\nvar parser = new Parser({\n    returnReply: function(reply) {\n        lib.returnReply(reply);\n    },\n    returnError: function(err) {\n        lib.returnError(err);\n    },\n    returnBuffers: true, // All strings are returned as Buffer e.g. <Buffer 48 65 6c 6c 6f>\n    stringNumbers: true // All numbers are returned as String\n});\n\n// The streamHandler as above\n```\n\n## Protocol errors\n\nTo handle protocol errors (this is very unlikely to happen) gracefully you should add the returnFatalError option, reject any still running command (they might have been processed properly but the reply is just wrong), destroy the socket and reconnect. Note that while doing this no new command may be added, so all new commands have to be buffered in the meantime, otherwise a chunk might still contain partial data of a following command that was already processed properly but answered in the same chunk as the command that resulted in the protocol error.\n\n## Contribute\n\nThe parser is highly optimized but there may still be further optimizations possible.\n\n    npm install\n    npm test\n    npm run benchmark\n\nCurrently the benchmark compares the performance against the hiredis parser:\n\n    HIREDIS: $ multiple chunks in a bulk string x 859,880 ops/sec ±1.22% (82 runs sampled)\n    HIREDIS BUF: $ multiple chunks in a bulk string x 608,869 ops/sec ±1.72% (85 runs sampled)\n    JS PARSER: $ multiple chunks in a bulk string x 910,590 ops/sec ±0.87% (89 runs sampled)\n    JS PARSER BUF: $ multiple chunks in a bulk string x 1,299,507 ops/sec ±2.18% (84 runs sampled)\n\n    HIREDIS: + multiple chunks in a string x 1,787,203 ops/sec ±0.58% (96 runs sampled)\n    HIREDIS BUF: + multiple chunks in a string x 943,584 ops/sec ±1.62% (87 runs sampled)\n    JS PARSER: + multiple chunks in a string x 2,008,264 ops/sec ±1.01% (91 runs sampled)\n    JS PARSER BUF: + multiple chunks in a string x 2,045,546 ops/sec ±0.78% (91 runs sampled)\n\n    HIREDIS: $ 4mb bulk string x 310 ops/sec ±1.58% (75 runs sampled)\n    HIREDIS BUF: $ 4mb bulk string x 471 ops/sec ±2.28% (78 runs sampled)\n    JS PARSER: $ 4mb bulk string x 747 ops/sec ±2.43% (85 runs sampled)\n    JS PARSER BUF: $ 4mb bulk string x 846 ops/sec ±5.52% (72 runs sampled)\n\n    HIREDIS: + simple string x 2,324,866 ops/sec ±1.61% (90 runs sampled)\n    HIREDIS BUF: + simple string x 1,085,823 ops/sec ±2.47% (82 runs sampled)\n    JS PARSER: + simple string x 4,567,358 ops/sec ±1.97% (81 runs sampled)\n    JS PARSER BUF: + simple string x 5,433,901 ops/sec ±0.66% (93 runs sampled)\n\n    HIREDIS: : integer x 2,332,946 ops/sec ±0.47% (93 runs sampled)\n    JS PARSER: : integer x 17,730,449 ops/sec ±0.73% (91 runs sampled)\n    JS PARSER STR: : integer x 12,942,037 ops/sec ±0.51% (92 runs sampled)\n\n    HIREDIS: : big integer x 2,012,572 ops/sec ±0.33% (93 runs sampled)\n    JS PARSER: : big integer x 10,210,923 ops/sec ±0.94% (94 runs sampled)\n    JS PARSER STR: : big integer x 4,453,320 ops/sec ±0.52% (94 runs sampled)\n\n    HIREDIS: * array x 44,479 ops/sec ±0.55% (94 runs sampled)\n    HIREDIS BUF: * array x 14,391 ops/sec ±1.04% (86 runs sampled)\n    JS PARSER: * array x 53,796 ops/sec ±2.08% (79 runs sampled)\n    JS PARSER BUF: * array x 72,428 ops/sec ±0.72% (93 runs sampled)\n\n    HIREDIS: * big nested array x 217 ops/sec ±0.97% (83 runs sampled)\n    HIREDIS BUF: * big nested array x 255 ops/sec ±2.28% (77 runs sampled)\n    JS PARSER: * big nested array x 242 ops/sec ±1.10% (85 runs sampled)\n    JS PARSER BUF: * big nested array x 375 ops/sec ±1.21% (88 runs sampled)\n\n    HIREDIS: - error x 78,821 ops/sec ±0.80% (93 runs sampled)\n    JS PARSER: - error x 143,382 ops/sec ±0.75% (92 runs sampled)\n\n    Platform info:\n    Ubuntu 16.10\n    Node.js 7.4.0\n    Intel(R) Core(TM) i7-5600U CPU\n\n## License\n\n[MIT](./LICENSE)\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/NodeRedis/node-redis-parser.git"
+  },
+  "scripts": {
+    "benchmark": "node ./benchmark",
+    "coverage": "node ./node_modules/istanbul/lib/cli.js cover --preserve-comments ./node_modules/mocha/bin/_mocha -- -R spec",
+    "coverage:check": "node ./node_modules/istanbul/lib/cli.js check-coverage --branch 100 --statement 100",
+    "lint": "standard --fix",
+    "posttest": "npm run lint && npm run coverage:check",
+    "test": "npm run coverage"
+  },
+  "version": "2.6.0"
+}
diff --git a/node_modules/redis/.eslintignore b/node_modules/redis/.eslintignore
new file mode 100644
index 0000000..fd16de3
--- /dev/null
+++ b/node_modules/redis/.eslintignore
@@ -0,0 +1,4 @@
+node_modules/**
+coverage/**
+**.md
+**.log
diff --git a/node_modules/redis/.eslintrc b/node_modules/redis/.eslintrc
new file mode 100644
index 0000000..75c7334
--- /dev/null
+++ b/node_modules/redis/.eslintrc
@@ -0,0 +1,108 @@
+env:
+  node: true
+  es6: false
+
+rules:
+  # Possible Errors
+  # http://eslint.org/docs/rules/#possible-errors
+  comma-dangle: [2, "only-multiline"]
+  no-constant-condition: 2
+  no-control-regex: 2
+  no-debugger: 2
+  no-dupe-args: 2
+  no-dupe-keys: 2
+  no-duplicate-case: 2
+  no-empty: 2
+  no-empty-character-class: 2
+  no-ex-assign: 2
+  no-extra-boolean-cast : 2
+  no-extra-parens: [2, "functions"]
+  no-extra-semi: 2
+  no-func-assign: 2
+  no-invalid-regexp: 2
+  no-irregular-whitespace: 2
+  no-negated-in-lhs: 2
+  no-obj-calls: 2
+  no-regex-spaces: 2
+  no-sparse-arrays: 2
+  no-inner-declarations: 2
+  no-unexpected-multiline: 2
+  no-unreachable: 2
+  use-isnan: 2
+  valid-typeof: 2
+
+  # Best Practices
+  # http://eslint.org/docs/rules/#best-practices
+  array-callback-return: 2
+  block-scoped-var: 2
+  dot-notation: 2
+  eqeqeq: 2
+  no-else-return: 2
+  no-extend-native: 2
+  no-floating-decimal: 2
+  no-extra-bind: 2
+  no-fallthrough: 2
+  no-labels: 2
+  no-lone-blocks: 2
+  no-loop-func: 2
+  no-multi-spaces: 2
+  no-multi-str: 2
+  no-native-reassign: 2
+  no-new-wrappers: 2
+  no-octal: 2
+  no-proto: 2
+  no-redeclare: 2
+  no-return-assign: 2
+  no-self-assign: 2
+  no-self-compare: 2
+  no-sequences: 2
+  no-throw-literal: 2
+  no-useless-call: 2
+  no-useless-concat: 2
+  no-useless-escape: 2
+  no-void: 2
+  no-unmodified-loop-condition: 2
+  yoda: 2
+
+  # Strict Mode
+  # http://eslint.org/docs/rules/#strict-mode
+  strict: [2, "global"]
+
+  # Variables
+  # http://eslint.org/docs/rules/#variables
+  no-delete-var: 2
+  no-shadow-restricted-names: 2
+  no-undef: 2
+  no-unused-vars: [2, {"args": "none"}]
+
+  # http://eslint.org/docs/rules/#nodejs-and-commonjs
+  no-mixed-requires: 2
+  no-new-require: 2
+  no-path-concat: 2
+
+  # Stylistic Issues
+  # http://eslint.org/docs/rules/#stylistic-issues
+  comma-spacing: 2
+  eol-last: 2
+  indent: [2, 4, {SwitchCase: 2}]
+  keyword-spacing: 2
+  max-len: [2, 200, 2]
+  new-parens: 2
+  no-mixed-spaces-and-tabs: 2
+  no-multiple-empty-lines: [2, {max: 2}]
+  no-trailing-spaces: 2
+  quotes: [2, "single", "avoid-escape"]
+  semi: 2
+  space-before-blocks: [2, "always"]
+  space-before-function-paren: [2, "always"]
+  space-in-parens: [2, "never"]
+  space-infix-ops: 2
+  space-unary-ops: 2
+
+globals:
+  it: true
+  describe: true
+  before: true
+  after: true
+  beforeEach: true
+  afterEach: true
diff --git a/node_modules/redis/.github/ISSUE_TEMPLATE.md b/node_modules/redis/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..42f2d3e
--- /dev/null
+++ b/node_modules/redis/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,15 @@
+_Thanks for wanting to report an issue you've found in node_redis. Please delete
+this text and fill in the template below. Please note that the issue tracker is only
+for bug reports or feature requests. If you have a question, please ask that on [gitter].
+If unsure about something, just do as best as you're able._
+
+_Note that it will be much easier to fix the issue if a test case that reproduces
+the problem is provided. It is of course not always possible to reduce your code
+to a small test case, but it's highly appreciated to have as much data as possible.
+Thank you!_
+
+* **Version**: What node_redis and what redis version is the issue happening on?
+* **Platform**: What platform / version? (For example Node.js 0.10 or Node.js 5.7.0 on Windows 7 / Ubuntu 15.10 / Azure)
+* **Description**: Description of your issue, stack traces from errors and code that reproduces the issue
+
+[gitter]: https://gitter.im/NodeRedis/node_redis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
\ No newline at end of file
diff --git a/node_modules/redis/.github/PULL_REQUEST_TEMPLATE.md b/node_modules/redis/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..9706621
--- /dev/null
+++ b/node_modules/redis/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,14 @@
+### Pull Request check-list
+
+_Please make sure to review and check all of these items:_
+
+- [ ] Does `npm test` pass with this change (including linting)?
+- [ ] Is the new or changed code fully tested?
+- [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
+
+_NOTE: these things are not required to open a PR and can be done
+afterwards / while the PR is open._
+
+### Description of change
+
+_Please provide a description of the change here._
\ No newline at end of file
diff --git a/node_modules/redis/.npmignore b/node_modules/redis/.npmignore
new file mode 100644
index 0000000..b0238e0
--- /dev/null
+++ b/node_modules/redis/.npmignore
@@ -0,0 +1,10 @@
+examples/
+benchmarks/
+test/
+.nyc_output/
+coverage/
+.tern-port
+*.log
+*.rdb
+*.out
+*.yml
diff --git a/node_modules/redis/LICENSE b/node_modules/redis/LICENSE
new file mode 100644
index 0000000..710407f
--- /dev/null
+++ b/node_modules/redis/LICENSE
@@ -0,0 +1,24 @@
+LICENSE - "MIT License"
+
+Copyright (c) 2016 by NodeRedis
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/redis/README.md b/node_modules/redis/README.md
new file mode 100644
index 0000000..205503b
--- /dev/null
+++ b/node_modules/redis/README.md
@@ -0,0 +1,965 @@
+redis - a node.js redis client
+===========================
+
+[![Build Status](https://travis-ci.org/NodeRedis/node_redis.svg?branch=master)](https://travis-ci.org/NodeRedis/node_redis)
+[![Coverage Status](https://coveralls.io/repos/NodeRedis/node_redis/badge.svg?branch=)](https://coveralls.io/r/NodeRedis/node_redis?branch=)
+[![Windows Tests](https://img.shields.io/appveyor/ci/BridgeAR/node-redis/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/BridgeAR/node-redis/branch/master)
+[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/NodeRedis/node_redis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
+
+This is a complete and feature rich Redis client for node.js. __It supports all
+Redis commands__ and focuses on high performance.
+
+Install with:
+
+    npm install redis
+
+## Usage Example
+
+```js
+var redis = require("redis"),
+    client = redis.createClient();
+
+// if you'd like to select database 3, instead of 0 (default), call
+// client.select(3, function() { /* ... */ });
+
+client.on("error", function (err) {
+    console.log("Error " + err);
+});
+
+client.set("string key", "string val", redis.print);
+client.hset("hash key", "hashtest 1", "some value", redis.print);
+client.hset(["hash key", "hashtest 2", "some other value"], redis.print);
+client.hkeys("hash key", function (err, replies) {
+    console.log(replies.length + " replies:");
+    replies.forEach(function (reply, i) {
+        console.log("    " + i + ": " + reply);
+    });
+    client.quit();
+});
+```
+
+This will display:
+
+    mjr:~/work/node_redis (master)$ node example.js
+    Reply: OK
+    Reply: 0
+    Reply: 0
+    2 replies:
+        0: hashtest 1
+        1: hashtest 2
+    mjr:~/work/node_redis (master)$
+
+Note that the API is entirely asynchronous. To get data back from the server,
+you'll need to use a callback. From v.2.6 on the API supports camelCase and
+snake_case and all options / variables / events etc. can be used either way. It
+is recommended to use camelCase as this is the default for the Node.js
+landscape.
+
+### Promises
+
+You can also use node_redis with promises by promisifying node_redis with
+[bluebird](https://github.com/petkaantonov/bluebird) as in:
+
+```js
+var redis = require('redis');
+bluebird.promisifyAll(redis.RedisClient.prototype);
+bluebird.promisifyAll(redis.Multi.prototype);
+```
+
+It'll add a *Async* to all node_redis functions (e.g. return client.getAsync().then())
+
+```js
+// We expect a value 'foo': 'bar' to be present
+// So instead of writing client.get('foo', cb); you have to write:
+return client.getAsync('foo').then(function(res) {
+    console.log(res); // => 'bar'
+});
+
+// Using multi with promises looks like:
+
+return client.multi().get('foo').execAsync().then(function(res) {
+    console.log(res); // => 'bar'
+});
+```
+
+### Sending Commands
+
+Each Redis command is exposed as a function on the `client` object.
+All functions take either an `args` Array plus optional `callback` Function or
+a variable number of individual arguments followed by an optional callback.
+Examples:
+
+```js
+client.hmset(["key", "test keys 1", "test val 1", "test keys 2", "test val 2"], function (err, res) {});
+// Works the same as
+client.hmset("key", ["test keys 1", "test val 1", "test keys 2", "test val 2"], function (err, res) {});
+// Or
+client.hmset("key", "test keys 1", "test val 1", "test keys 2", "test val 2", function (err, res) {});
+```
+
+Note that in either form the `callback` is optional:
+
+```js
+client.set("some key", "some val");
+client.set(["some other key", "some val"]);
+```
+
+If the key is missing, reply will be null. Only if the [Redis Command
+Reference](http://redis.io/commands) states something else it will not be null.
+
+```js
+client.get("missingkey", function(err, reply) {
+    // reply is null when the key is missing
+    console.log(reply);
+});
+```
+
+For a list of Redis commands, see [Redis Command Reference](http://redis.io/commands)
+
+Minimal parsing is done on the replies. Commands that return a integer return
+JavaScript Numbers, arrays return JavaScript Array. `HGETALL` returns an Object
+keyed by the hash keys. All strings will either be returned as string or as
+buffer depending on your setting. Please be aware that sending null, undefined
+and Boolean values will result in the value coerced to a string!
+
+# Redis Commands
+
+This library is a 1 to 1 mapping to [Redis commands](https://redis.io/commands).
+It is not a cache library so please refer to Redis commands page for full usage
+details.
+
+Example setting key to auto expire using [SET command](https://redis.io/commands/set)
+
+```js
+// this key will expire after 10 seconds
+client.set('key', 'value!', 'EX', 10);
+```
+
+# API
+
+## Connection and other Events
+
+`client` will emit some events about the state of the connection to the Redis server.
+
+### "ready"
+
+`client` will emit `ready` once a connection is established. Commands issued
+before the `ready` event are queued, then replayed just before this event is
+emitted.
+
+### "connect"
+
+`client` will emit `connect` as soon as the stream is connected to the server.
+
+### "reconnecting"
+
+`client` will emit `reconnecting` when trying to reconnect to the Redis server
+after losing the connection. Listeners are passed an object containing `delay`
+(in ms) and `attempt` (the attempt #) attributes.
+
+### "error"
+
+`client` will emit `error` when encountering an error connecting to the Redis
+server or when any other in node_redis occurs. If you use a command without
+callback and encounter a ReplyError it is going to be emitted to the error
+listener.
+
+So please attach the error listener to node_redis.
+
+### "end"
+
+`client` will emit `end` when an established Redis server connection has closed.
+
+### "drain" (deprecated)
+
+`client` will emit `drain` when the TCP connection to the Redis server has been
+buffering, but is now writable. This event can be used to stream commands in to
+Redis and adapt to backpressure.
+
+If the stream is buffering `client.should_buffer` is set to true. Otherwise the
+variable is always set to false. That way you can decide when to reduce your
+send rate and resume sending commands when you get `drain`.
+
+You can also check the return value of each command as it will also return the
+backpressure indicator (deprecated). If false is returned the stream had to
+buffer.
+
+### "warning"
+
+`client` will emit `warning` when password was set but none is needed and if a
+deprecated option / function / similar is used.
+
+### "idle" (deprecated)
+
+`client` will emit `idle` when there are no outstanding commands that are
+awaiting a response.
+
+## redis.createClient()
+If you have `redis-server` running on the same machine as node, then the
+defaults for port and host are probably fine and you don't need to supply any
+arguments. `createClient()` returns a `RedisClient` object. Otherwise,
+`createClient()` accepts these arguments:
+
+* `redis.createClient([options])`
+* `redis.createClient(unix_socket[, options])`
+* `redis.createClient(redis_url[, options])`
+* `redis.createClient(port[, host][, options])`
+
+__Tip:__ If the Redis server runs on the same machine as the client consider
+using unix sockets if possible to increase throughput.
+
+#### `options` object properties
+| Property  | Default   | Description |
+|-----------|-----------|-------------|
+| host      | 127.0.0.1 | IP address of the Redis server |
+| port      | 6379      | Port of the Redis server |
+| path      | null      | The UNIX socket string of the Redis server |
+| url       | null      | The URL of the Redis server. Format: `[redis:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]` (More info avaliable at [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis)). |
+| parser    | javascript | __Deprecated__ Use either the built-in JS parser [`javascript`]() or the native [`hiredis`]() parser. __Note__ `node_redis` < 2.6 uses hiredis as default if installed. This changed in v.2.6.0. |
+| string_numbers | null | Set to `true`, `node_redis` will return Redis number values as Strings instead of javascript Numbers. Useful if you need to handle big numbers (above `Number.MAX_SAFE_INTEGER === 2^53`). Hiredis is incapable of this behavior, so setting this option to `true` will result in the built-in javascript parser being used no matter the value of the `parser` option. |
+| return_buffers | false | If set to `true`, then all replies will be sent to callbacks as Buffers instead of Strings. |
+| detect_buffers | false | If set to `true`, then replies will be sent to callbacks as Buffers. This option lets you switch between Buffers and Strings on a per-command basis, whereas `return_buffers` applies to every command on a client. __Note__: This doesn't work properly with the pubsub mode. A subscriber has to either always return Strings or Buffers. |
+| socket_keepalive | true | If set to `true`, the keep-alive functionality is enabled on the underlying socket. |
+| no_ready_check | false |  When a connection is established to the Redis server, the server might still be loading the database from disk. While loading, the server will not respond to any commands. To work around this, `node_redis` has a "ready check" which sends the `INFO` command to the server. The response from the `INFO` command indicates whether the server is ready for more commands. When ready, `node_redis` emits a `ready` event. Setting `no_ready_check` to `true` will inhibit this check. |
+| enable_offline_queue |  true | By default, if there is no active connection to the Redis server, commands are added to a queue and are executed once the connection has been established. Setting `enable_offline_queue` to `false` will disable this feature and the callback will be executed immediately with an error, or an error will be emitted if no callback is specified. |
+| retry_max_delay | null | __Deprecated__ _Please use `retry_strategy` instead._ By default, every time the client tries to connect and fails, the reconnection delay almost doubles. This delay normally grows infinitely, but setting `retry_max_delay` limits it to the maximum value provided in milliseconds. |
+| connect_timeout | 3600000 | __Deprecated__ _Please use `retry_strategy` instead._ Setting `connect_timeout` limits the total time for the client to connect and reconnect. The value is provided in milliseconds and is counted from the moment a new client is created or from the time the connection is lost. The last retry is going to happen exactly at the timeout time. Default is to try connecting until the default system socket timeout has been exceeded and to try reconnecting until 1h has elapsed. |
+| max_attempts | 0 | __Deprecated__ _Please use `retry_strategy` instead._ By default, a client will try reconnecting until connected. Setting `max_attempts` limits total amount of connection attempts. Setting this to 1 will prevent any reconnect attempt. |
+| retry_unfulfilled_commands | false | If set to `true`, all commands that were unfulfilled while the connection is lost will be retried after the connection has been reestablished. Use this with caution if you use state altering commands (e.g. `incr`). This is especially useful if you use blocking commands. |
+| password | null | If set, client will run Redis auth command on connect. Alias `auth_pass` __Note__ `node_redis` < 2.5 must use `auth_pass` |
+| db | null | If set, client will run Redis `select` command on connect. |
+| family | IPv4 | You can force using IPv6 if you set the family to 'IPv6'. See Node.js [net](https://nodejs.org/api/net.html) or [dns](https://nodejs.org/api/dns.html) modules on how to use the family type. |
+| disable_resubscribing | false | If set to `true`, a client won't resubscribe after disconnecting. |
+| rename_commands | null | Passing an object with renamed commands to use instead of the original functions. For example, if you renamed the command KEYS to "DO-NOT-USE" then the rename_commands object would be: `{ KEYS : "DO-NOT-USE" }` . See the [Redis security topics](http://redis.io/topics/security) for more info. |
+| tls | null | An object containing options to pass to [tls.connect](http://nodejs.org/api/tls.html#tls_tls_connect_port_host_options_callback) to set up a TLS connection to Redis (if, for example, it is set up to be accessible via a tunnel). |
+| prefix | null | A string used to prefix all used keys (e.g. `namespace:test`). Please be aware that the `keys` command will not be prefixed. The `keys` command has a "pattern" as argument and no key and it would be impossible to determine the existing keys in Redis if this would be prefixed. |
+| retry_strategy | function | A function that receives an options object as parameter including the retry `attempt`, the `total_retry_time` indicating how much time passed since the last time connected, the `error` why the connection was lost and the number of `times_connected` in total. If you return a number from this function, the retry will happen exactly after that time in milliseconds. If you return a non-number, no further retry will happen and all offline commands are flushed with errors. Return an error to return that specific error to all offline commands. Example below. |
+
+```js
+var redis = require("redis");
+var client = redis.createClient({detect_buffers: true});
+
+client.set("foo_rand000000000000", "OK");
+
+// This will return a JavaScript String
+client.get("foo_rand000000000000", function (err, reply) {
+    console.log(reply.toString()); // Will print `OK`
+});
+
+// This will return a Buffer since original key is specified as a Buffer
+client.get(new Buffer("foo_rand000000000000"), function (err, reply) {
+    console.log(reply.toString()); // Will print `<Buffer 4f 4b>`
+});
+client.quit();
+```
+
+retry_strategy example
+
+```js
+var client = redis.createClient({
+    retry_strategy: function (options) {
+        if (options.error && options.error.code === 'ECONNREFUSED') {
+            // End reconnecting on a specific error and flush all commands with
+            // a individual error
+            return new Error('The server refused the connection');
+        }
+        if (options.total_retry_time > 1000 * 60 * 60) {
+            // End reconnecting after a specific timeout and flush all commands
+            // with a individual error
+            return new Error('Retry time exhausted');
+        }
+        if (options.attempt > 10) {
+            // End reconnecting with built in error
+            return undefined;
+        }
+        // reconnect after
+        return Math.min(options.attempt * 100, 3000);
+    }
+});
+```
+
+## client.auth(password[, callback])
+
+When connecting to a Redis server that requires authentication, the `AUTH`
+command must be sent as the first command after connecting. This can be tricky
+to coordinate with reconnections, the ready check, etc. To make this easier,
+`client.auth()` stashes `password` and will send it after each connection,
+including reconnections. `callback` is invoked only once, after the response to
+the very first `AUTH` command sent.
+NOTE: Your call to `client.auth()` should not be inside the ready handler. If
+you are doing this wrong, `client` will emit an error that looks
+something like this `Error: Ready check failed: ERR operation not permitted`.
+
+## backpressure
+
+### stream
+
+The client exposed the used [stream](https://nodejs.org/api/stream.html) in
+`client.stream` and if the stream or client had to
+[buffer](https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback)
+the command in `client.should_buffer`. In combination this can be used to
+implement backpressure by checking the buffer state before sending a command and
+listening to the stream
+[drain](https://nodejs.org/api/stream.html#stream_event_drain) event.
+
+## client.quit()
+
+This sends the quit command to the redis server and ends cleanly right after all
+running commands were properly handled. If this is called while reconnecting
+(and therefore no connection to the redis server exists) it is going to end the
+connection right away instead of resulting in further reconnections! All offline
+commands are going to be flushed with an error in that case.
+
+## client.end(flush)
+
+Forcibly close the connection to the Redis server. Note that this does not wait
+until all replies have been parsed. If you want to exit cleanly, call
+`client.quit()` as mentioned above.
+
+You should set flush to true, if you are not absolutely sure you do not care
+about any other commands. If you set flush to false all still running commands
+will silently fail.
+
+This example closes the connection to the Redis server before the replies have
+been read. You probably don't want to do this:
+
+```js
+var redis = require("redis"),
+    client = redis.createClient();
+
+client.set("foo_rand000000000000", "some fantastic value", function (err, reply) {
+    // This will either result in an error (flush parameter is set to true)
+    // or will silently fail and this callback will not be called at all (flush set to false)
+    console.log(err);
+});
+client.end(true); // No further commands will be processed
+client.get("foo_rand000000000000", function (err, reply) {
+    console.log(err); // => 'The connection has already been closed.'
+});
+```
+
+`client.end()` without the flush parameter set to true should NOT be used in production!
+
+## Error handling (>= v.2.6)
+
+Currently the following error subclasses exist:
+
+* `RedisError`: _All errors_ returned by the client
+* `ReplyError` subclass of `RedisError`: All errors returned by __Redis__ itself
+* `AbortError` subclass of `RedisError`: All commands that could not finish due
+  to what ever reason
+* `ParserError` subclass of `RedisError`: Returned in case of a parser error
+  (this should not happen)
+* `AggregateError` subclass of `AbortError`: Emitted in case multiple unresolved
+  commands without callback got rejected in debug_mode instead of lots of
+  `AbortError`s.
+
+All error classes are exported by the module.
+
+Example:
+```js
+var redis = require('./');
+var assert = require('assert');
+var client = redis.createClient();
+
+client.on('error', function (err) {
+    assert(err instanceof Error);
+    assert(err instanceof redis.AbortError);
+    assert(err instanceof redis.AggregateError);
+    // The set and get get aggregated in here
+    assert.strictEqual(err.errors.length, 2);
+    assert.strictEqual(err.code, 'NR_CLOSED');
+});
+client.set('foo', 123, 'bar', function (err, res) { // Too many arguments
+    assert(err instanceof redis.ReplyError); // => true
+    assert.strictEqual(err.command, 'SET');
+    assert.deepStrictEqual(err.args, ['foo', 123, 'bar']);
+
+    redis.debug_mode = true;
+    client.set('foo', 'bar');
+    client.get('foo');
+    process.nextTick(function () {
+        // Force closing the connection while the command did not yet return
+        client.end(true);
+        redis.debug_mode = false;
+    });
+});
+
+```
+
+Every `ReplyError` contains the `command` name in all-caps and the arguments (`args`).
+
+If node_redis emits a library error because of another error, the triggering
+error is added to the returned error as `origin` attribute.
+
+___Error codes___
+
+node_redis returns a `NR_CLOSED` error code if the clients connection dropped.
+If a command unresolved command got rejected a `UNCERTAIN_STATE` code is
+returned. A `CONNECTION_BROKEN` error code is used in case node_redis gives up
+to reconnect.
+
+## client.unref()
+
+Call `unref()` on the underlying socket connection to the Redis server, allowing
+the program to exit once no more commands are pending.
+
+This is an **experimental** feature, and only supports a subset of the Redis
+protocol. Any commands where client state is saved on the Redis server, e.g.
+`*SUBSCRIBE` or the blocking `BL*` commands will *NOT* work with `.unref()`.
+
+```js
+var redis = require("redis")
+var client = redis.createClient()
+
+/*
+    Calling unref() will allow this program to exit immediately after the get
+    command finishes. Otherwise the client would hang as long as the
+    client-server connection is alive.
+*/
+client.unref()
+client.get("foo", function (err, value){
+    if (err) throw(err)
+    console.log(value)
+})
+```
+
+## Friendlier hash commands
+
+Most Redis commands take a single String or an Array of Strings as arguments,
+and replies are sent back as a single String or an Array of Strings. When
+dealing with hash values, there are a couple of useful exceptions to this.
+
+### client.hgetall(hash, callback)
+
+The reply from an HGETALL command will be converted into a JavaScript Object by
+`node_redis`. That way you can interact with the responses using JavaScript
+syntax.
+
+Example:
+
+```js
+client.hmset("hosts", "mjr", "1", "another", "23", "home", "1234");
+client.hgetall("hosts", function (err, obj) {
+    console.dir(obj);
+});
+```
+
+Output:
+
+```js
+{ mjr: '1', another: '23', home: '1234' }
+```
+
+### client.hmset(hash, obj[, callback])
+
+Multiple values in a hash can be set by supplying an object:
+
+```js
+client.HMSET(key2, {
+    "0123456789": "abcdefghij", // NOTE: key and value will be coerced to strings
+    "some manner of key": "a type of value"
+});
+```
+
+The properties and values of this Object will be set as keys and values in the
+Redis hash.
+
+### client.hmset(hash, key1, val1, ... keyn, valn, [callback])
+
+Multiple values may also be set by supplying a list:
+
+```js
+client.HMSET(key1, "0123456789", "abcdefghij", "some manner of key", "a type of value");
+```
+
+## Publish / Subscribe
+
+Example of the publish / subscribe API. This program opens two
+client connections, subscribes to a channel on one of them, and publishes to that
+channel on the other:
+
+```js
+var redis = require("redis");
+var sub = redis.createClient(), pub = redis.createClient();
+var msg_count = 0;
+
+sub.on("subscribe", function (channel, count) {
+    pub.publish("a nice channel", "I am sending a message.");
+    pub.publish("a nice channel", "I am sending a second message.");
+    pub.publish("a nice channel", "I am sending my last message.");
+});
+
+sub.on("message", function (channel, message) {
+    console.log("sub channel " + channel + ": " + message);
+    msg_count += 1;
+    if (msg_count === 3) {
+        sub.unsubscribe();
+        sub.quit();
+        pub.quit();
+    }
+});
+
+sub.subscribe("a nice channel");
+```
+
+When a client issues a `SUBSCRIBE` or `PSUBSCRIBE`, that connection is put into
+a "subscriber" mode. At that point, only commands that modify the subscription
+set are valid and quit (and depending on the redis version ping as well). When
+the subscription set is empty, the connection is put back into regular mode.
+
+If you need to send regular commands to Redis while in subscriber mode, just
+open another connection with a new client (hint: use `client.duplicate()`).
+
+## Subscriber Events
+
+If a client has subscriptions active, it may emit these events:
+
+### "message" (channel, message)
+
+Client will emit `message` for every message received that matches an active subscription.
+Listeners are passed the channel name as `channel` and the message as `message`.
+
+### "pmessage" (pattern, channel, message)
+
+Client will emit `pmessage` for every message received that matches an active
+subscription pattern. Listeners are passed the original pattern used with
+`PSUBSCRIBE` as `pattern`, the sending channel name as `channel`, and the
+message as `message`.
+
+### "message_buffer" (channel, message)
+
+This is the same as the `message` event with the exception, that it is always
+going to emit a buffer. If you listen to the `message` event at the same time as
+the `message_buffer`, it is always going to emit a string.
+
+### "pmessage_buffer" (pattern, channel, message)
+
+This is the same as the `pmessage` event with the exception, that it is always
+going to emit a buffer. If you listen to the `pmessage` event at the same time
+as the `pmessage_buffer`, it is always going to emit a string.
+
+### "subscribe" (channel, count)
+
+Client will emit `subscribe` in response to a `SUBSCRIBE` command. Listeners are
+passed the channel name as `channel` and the new count of subscriptions for this
+client as `count`.
+
+### "psubscribe" (pattern, count)
+
+Client will emit `psubscribe` in response to a `PSUBSCRIBE` command. Listeners
+are passed the original pattern as `pattern`, and the new count of subscriptions
+for this client as `count`.
+
+### "unsubscribe" (channel, count)
+
+Client will emit `unsubscribe` in response to a `UNSUBSCRIBE` command. Listeners
+are passed the channel name as `channel` and the new count of subscriptions for
+this client as `count`. When `count` is 0, this client has left subscriber mode
+and no more subscriber events will be emitted.
+
+### "punsubscribe" (pattern, count)
+
+Client will emit `punsubscribe` in response to a `PUNSUBSCRIBE` command.
+Listeners are passed the channel name as `channel` and the new count of
+subscriptions for this client as `count`. When `count` is 0, this client has
+left subscriber mode and no more subscriber events will be emitted.
+
+## client.multi([commands])
+
+`MULTI` commands are queued up until an `EXEC` is issued, and then all commands
+are run atomically by Redis. The interface in `node_redis` is to return an
+individual `Multi` object by calling `client.multi()`. If any command fails to
+queue, all commands are rolled back and none is going to be executed (For
+further information look at
+[transactions](http://redis.io/topics/transactions)).
+
+```js
+var redis  = require("./index"),
+    client = redis.createClient(), set_size = 20;
+
+client.sadd("bigset", "a member");
+client.sadd("bigset", "another member");
+
+while (set_size > 0) {
+    client.sadd("bigset", "member " + set_size);
+    set_size -= 1;
+}
+
+// multi chain with an individual callback
+client.multi()
+    .scard("bigset")
+    .smembers("bigset")
+    .keys("*", function (err, replies) {
+        // NOTE: code in this callback is NOT atomic
+        // this only happens after the the .exec call finishes.
+        client.mget(replies, redis.print);
+    })
+    .dbsize()
+    .exec(function (err, replies) {
+        console.log("MULTI got " + replies.length + " replies");
+        replies.forEach(function (reply, index) {
+            console.log("Reply " + index + ": " + reply.toString());
+        });
+    });
+```
+
+### Multi.exec([callback])
+
+`client.multi()` is a constructor that returns a `Multi` object. `Multi` objects
+share all of the same command methods as `client` objects do. Commands are
+queued up inside the `Multi` object until `Multi.exec()` is invoked.
+
+If your code contains an syntax error an EXECABORT error is going to be thrown
+and all commands are going to be aborted. That error contains a `.errors`
+property that contains the concrete errors.
+If all commands were queued successfully and an error is thrown by redis while
+processing the commands that error is going to be returned in the result array!
+No other command is going to be aborted though than the onces failing.
+
+You can either chain together `MULTI` commands as in the above example, or you
+can queue individual commands while still sending regular client command as in
+this example:
+
+```js
+var redis  = require("redis"),
+    client = redis.createClient(), multi;
+
+// start a separate multi command queue
+multi = client.multi();
+multi.incr("incr thing", redis.print);
+multi.incr("incr other thing", redis.print);
+
+// runs immediately
+client.mset("incr thing", 100, "incr other thing", 1, redis.print);
+
+// drains multi queue and runs atomically
+multi.exec(function (err, replies) {
+    console.log(replies); // 101, 2
+});
+```
+
+In addition to adding commands to the `MULTI` queue individually, you can also
+pass an array of commands and arguments to the constructor:
+
+```js
+var redis  = require("redis"),
+    client = redis.createClient(), multi;
+
+client.multi([
+    ["mget", "multifoo", "multibar", redis.print],
+    ["incr", "multifoo"],
+    ["incr", "multibar"]
+]).exec(function (err, replies) {
+    console.log(replies);
+});
+```
+
+### Multi.exec_atomic([callback])
+
+Identical to Multi.exec but with the difference that executing a single command
+will not use transactions.
+
+## client.batch([commands])
+
+Identical to .multi without transactions. This is recommended if you want to
+execute many commands at once but don't have to rely on transactions.
+
+`BATCH` commands are queued up until an `EXEC` is issued, and then all commands
+are run atomically by Redis. The interface in `node_redis` is to return an
+individual `Batch` object by calling `client.batch()`. The only difference
+between .batch and .multi is that no transaction is going to be used.
+Be aware that the errors are - just like in multi statements - in the result.
+Otherwise both, errors and results could be returned at the same time.
+
+If you fire many commands at once this is going to boost the execution speed
+significantly compared to firing the same commands in a loop without waiting for
+the result! See the benchmarks for further comparison. Please remember that all
+commands are kept in memory until they are fired.
+
+## Monitor mode
+
+Redis supports the `MONITOR` command, which lets you see all commands received
+by the Redis server across all client connections, including from other client
+libraries and other computers.
+
+A `monitor` event is going to be emitted for every command fired from any client
+connected to the server including the monitoring client itself. The callback for
+the `monitor` event takes a timestamp from the Redis server, an array of command
+arguments and the raw monitoring string.
+
+Example:
+
+```js
+var client  = require("redis").createClient();
+client.monitor(function (err, res) {
+    console.log("Entering monitoring mode.");
+});
+client.set('foo', 'bar');
+
+client.on("monitor", function (time, args, raw_reply) {
+    console.log(time + ": " + args); // 1458910076.446514:['set', 'foo', 'bar']
+});
+```
+
+# Extras
+
+Some other things you might like to know about.
+
+## client.server_info
+
+After the ready probe completes, the results from the INFO command are saved in
+the `client.server_info` object.
+
+The `versions` key contains an array of the elements of the version string for
+easy comparison.
+
+    > client.server_info.redis_version
+    '2.3.0'
+    > client.server_info.versions
+    [ 2, 3, 0 ]
+
+## redis.print()
+
+A handy callback function for displaying return values when testing. Example:
+
+```js
+var redis = require("redis"),
+    client = redis.createClient();
+
+client.on("connect", function () {
+    client.set("foo_rand000000000000", "some fantastic value", redis.print);
+    client.get("foo_rand000000000000", redis.print);
+});
+```
+
+This will print:
+
+    Reply: OK
+    Reply: some fantastic value
+
+Note that this program will not exit cleanly because the client is still connected.
+
+## Multi-word commands
+
+To execute redis multi-word commands like `SCRIPT LOAD` or `CLIENT LIST` pass
+the second word as first parameter:
+
+    client.script('load', 'return 1');
+    client.multi().script('load', 'return 1').exec(...);
+    client.multi([['script', 'load', 'return 1']]).exec(...);
+
+## client.duplicate([options][, callback])
+
+Duplicate all current options and return a new redisClient instance. All options
+passed to the duplicate function are going to replace the original option. If
+you pass a callback, duplicate is going to wait until the client is ready and
+returns it in the callback. If an error occurs in the meanwhile, that is going
+to return an error instead in the callback.
+
+One example of when to use duplicate() would be to accommodate the connection-
+blocking redis commands BRPOP, BLPOP, and BRPOPLPUSH.  If these commands
+are used on the same redisClient instance as non-blocking commands, the
+non-blocking ones may be queued up until after the blocking ones finish.
+
+    var Redis=require('redis');
+    var client = Redis.createClient();
+    var clientBlocking = client.duplicate();
+
+    var get = function() {
+        console.log("get called");
+        client.get("any_key",function() { console.log("get returned"); });
+        setTimeout( get, 1000 );
+    };
+    var brpop = function() {
+        console.log("brpop called");
+        clientBlocking.brpop("nonexistent", 5, function() {
+            console.log("brpop return");
+            setTimeout( brpop, 1000 );
+        });
+    };
+    get();
+    brpop();
+
+Another reason to use duplicate() is when multiple DBs on the same server are
+accessed via the redis SELECT command.  Each DB could use its own connection.
+
+## client.send_command(command_name[, [args][, callback]])
+
+All Redis commands have been added to the `client` object. However, if new
+commands are introduced before this library is updated or if you want to add
+individual commands you can use `send_command()` to send arbitrary commands to
+Redis.
+
+All commands are sent as multi-bulk commands. `args` can either be an Array of
+arguments, or omitted / set to undefined.
+
+## client.add_command(command_name)
+
+Calling add_command will add a new command to the prototype. The exact command
+name will be used when calling using this new command. Using arbitrary arguments
+is possible as with any other command.
+
+## client.connected
+
+Boolean tracking the state of the connection to the Redis server.
+
+## client.command_queue_length
+
+The number of commands that have been sent to the Redis server but not yet
+replied to. You can use this to enforce some kind of maximum queue depth for
+commands while connected.
+
+## client.offline_queue_length
+
+The number of commands that have been queued up for a future connection. You can
+use this to enforce some kind of maximum queue depth for pre-connection
+commands.
+
+### Commands with Optional and Keyword arguments
+
+This applies to anything that uses an optional `[WITHSCORES]` or `[LIMIT offset
+count]` in the [redis.io/commands](http://redis.io/commands) documentation.
+
+Example:
+
+```js
+var args = [ 'myzset', 1, 'one', 2, 'two', 3, 'three', 99, 'ninety-nine' ];
+client.zadd(args, function (err, response) {
+    if (err) throw err;
+    console.log('added '+response+' items.');
+
+    // -Infinity and +Infinity also work
+    var args1 = [ 'myzset', '+inf', '-inf' ];
+    client.zrevrangebyscore(args1, function (err, response) {
+        if (err) throw err;
+        console.log('example1', response);
+        // write your code here
+    });
+
+    var max = 3, min = 1, offset = 1, count = 2;
+    var args2 = [ 'myzset', max, min, 'WITHSCORES', 'LIMIT', offset, count ];
+    client.zrevrangebyscore(args2, function (err, response) {
+        if (err) throw err;
+        console.log('example2', response);
+        // write your code here
+    });
+});
+```
+
+## Performance
+
+Much effort has been spent to make `node_redis` as fast as possible for common
+operations.
+
+```
+Lenovo T450s, i7-5600U and 12gb memory
+clients: 1, NodeJS: 6.2.0, Redis: 3.2.0, parser: javascript, connected by: tcp
+         PING,         1/1 avg/max:   0.02/  5.26 2501ms total,   46916 ops/sec
+         PING,  batch 50/1 avg/max:   0.06/  4.35 2501ms total,  755178 ops/sec
+   SET 4B str,         1/1 avg/max:   0.02/  4.75 2501ms total,   40856 ops/sec
+   SET 4B str,  batch 50/1 avg/max:   0.11/  1.51 2501ms total,  432727 ops/sec
+   SET 4B buf,         1/1 avg/max:   0.05/  2.76 2501ms total,   20659 ops/sec
+   SET 4B buf,  batch 50/1 avg/max:   0.25/  1.76 2501ms total,  194962 ops/sec
+   GET 4B str,         1/1 avg/max:   0.02/  1.55 2501ms total,   45156 ops/sec
+   GET 4B str,  batch 50/1 avg/max:   0.09/  3.15 2501ms total,  524110 ops/sec
+   GET 4B buf,         1/1 avg/max:   0.02/  3.07 2501ms total,   44563 ops/sec
+   GET 4B buf,  batch 50/1 avg/max:   0.10/  3.18 2501ms total,  473171 ops/sec
+ SET 4KiB str,         1/1 avg/max:   0.03/  1.54 2501ms total,   32627 ops/sec
+ SET 4KiB str,  batch 50/1 avg/max:   0.34/  1.89 2501ms total,  146861 ops/sec
+ SET 4KiB buf,         1/1 avg/max:   0.05/  2.85 2501ms total,   20688 ops/sec
+ SET 4KiB buf,  batch 50/1 avg/max:   0.36/  1.83 2501ms total,  138165 ops/sec
+ GET 4KiB str,         1/1 avg/max:   0.02/  1.37 2501ms total,   39389 ops/sec
+ GET 4KiB str,  batch 50/1 avg/max:   0.24/  1.81 2501ms total,  208157 ops/sec
+ GET 4KiB buf,         1/1 avg/max:   0.02/  2.63 2501ms total,   39918 ops/sec
+ GET 4KiB buf,  batch 50/1 avg/max:   0.31/  8.56 2501ms total,  161575 ops/sec
+         INCR,         1/1 avg/max:   0.02/  4.69 2501ms total,   45685 ops/sec
+         INCR,  batch 50/1 avg/max:   0.09/  3.06 2501ms total,  539964 ops/sec
+        LPUSH,         1/1 avg/max:   0.02/  3.04 2501ms total,   41253 ops/sec
+        LPUSH,  batch 50/1 avg/max:   0.12/  1.94 2501ms total,  425090 ops/sec
+    LRANGE 10,         1/1 avg/max:   0.02/  2.28 2501ms total,   39850 ops/sec
+    LRANGE 10,  batch 50/1 avg/max:   0.25/  1.85 2501ms total,  194302 ops/sec
+   LRANGE 100,         1/1 avg/max:   0.05/  2.93 2501ms total,   21026 ops/sec
+   LRANGE 100,  batch 50/1 avg/max:   1.52/  2.89 2501ms total,   32767 ops/sec
+ SET 4MiB str,         1/1 avg/max:   5.16/ 15.55 2502ms total,     193 ops/sec
+ SET 4MiB str,  batch 20/1 avg/max:  89.73/ 99.96 2513ms total,     223 ops/sec
+ SET 4MiB buf,         1/1 avg/max:   2.23/  8.35 2501ms total,     446 ops/sec
+ SET 4MiB buf,  batch 20/1 avg/max:  41.47/ 50.91 2530ms total,     482 ops/sec
+ GET 4MiB str,         1/1 avg/max:   2.79/ 10.91 2502ms total,     358 ops/sec
+ GET 4MiB str,  batch 20/1 avg/max: 101.61/118.11 2541ms total,     197 ops/sec
+ GET 4MiB buf,         1/1 avg/max:   2.32/ 14.93 2502ms total,     430 ops/sec
+ GET 4MiB buf,  batch 20/1 avg/max:  65.01/ 84.72 2536ms total,     308 ops/sec
+ ```
+
+## Debugging
+
+To get debug output run your `node_redis` application with `NODE_DEBUG=redis`.
+
+This is also going to result in good stack traces opposed to useless ones
+otherwise for any async operation.
+If you only want to have good stack traces but not the debug output run your
+application in development mode instead (`NODE_ENV=development`).
+
+Good stack traces are only activated in development and debug mode as this
+results in a significant performance penalty.
+
+___Comparison___:
+Useless stack trace:
+```
+ReplyError: ERR wrong number of arguments for 'set' command
+    at parseError (/home/ruben/repos/redis/node_modules/redis-parser/lib/parser.js:158:12)
+    at parseType (/home/ruben/repos/redis/node_modules/redis-parser/lib/parser.js:219:14)
+```
+Good stack trace:
+```
+ReplyError: ERR wrong number of arguments for 'set' command
+    at new Command (/home/ruben/repos/redis/lib/command.js:9:902)
+    at RedisClient.set (/home/ruben/repos/redis/lib/commands.js:9:3238)
+    at Context.<anonymous> (/home/ruben/repos/redis/test/good_stacks.spec.js:20:20)
+    at callFnAsync (/home/ruben/repos/redis/node_modules/mocha/lib/runnable.js:349:8)
+    at Test.Runnable.run (/home/ruben/repos/redis/node_modules/mocha/lib/runnable.js:301:7)
+    at Runner.runTest (/home/ruben/repos/redis/node_modules/mocha/lib/runner.js:422:10)
+    at /home/ruben/repos/redis/node_modules/mocha/lib/runner.js:528:12
+    at next (/home/ruben/repos/redis/node_modules/mocha/lib/runner.js:342:14)
+    at /home/ruben/repos/redis/node_modules/mocha/lib/runner.js:352:7
+    at next (/home/ruben/repos/redis/node_modules/mocha/lib/runner.js:284:14)
+    at Immediate._onImmediate (/home/ruben/repos/redis/node_modules/mocha/lib/runner.js:320:5)
+    at processImmediate [as _immediateCallback] (timers.js:383:17)
+```
+
+## How to Contribute
+- Open a pull request or an issue about what you want to implement / change. We're glad for any help!
+ - Please be aware that we'll only accept fully tested code.
+
+## Contributors
+
+The original author of node_redis is [Matthew Ranney](https://github.com/mranney)
+
+The current lead maintainer is [Ruben Bridgewater](https://github.com/BridgeAR)
+
+Many [others](https://github.com/NodeRedis/node_redis/graphs/contributors)
+contributed to `node_redis` too. Thanks to all of them!
+
+## License
+
+[MIT](LICENSE)
+
+### Consolidation: It's time for celebration
+
+Right now there are two great redis clients around and both have some advantages
+above each other. We speak about ioredis and node_redis. So after talking to
+each other about how we could improve in working together we (that is @luin and
+@BridgeAR) decided to work towards a single library on the long run. But step by
+step.
+
+First of all, we want to split small parts of our libraries into others so that
+we're both able to use the same code. Those libraries are going to be maintained
+under the NodeRedis organization. This is going to reduce the maintenance
+overhead, allows others to use the very same code, if they need it and it's way
+easyer for others to contribute to both libraries.
+
+We're very happy about this step towards working together as we both want to
+give you the best redis experience possible.
+
+If you want to join our cause by help maintaining something, please don't
+hesitate to contact either one of us.
diff --git a/node_modules/redis/changelog.md b/node_modules/redis/changelog.md
new file mode 100644
index 0000000..d650f9b
--- /dev/null
+++ b/node_modules/redis/changelog.md
@@ -0,0 +1,845 @@
+# Changelog
+
+## v.2.8.0 - 31 Jul, 2017
+
+Features
+
+- Accept UPPER_CASE commands in send_command
+- Add arbitrary commands to the prototype by using `Redis.addCommand(name)`
+
+Bugfixes
+
+- Fixed not always copying subscribe unsubscribe arguments
+- Fixed emitting internal errors while reconnecting with auth
+- Fixed crashing with invalid url option
+
+## v.2.7.1 - 14 Mar, 2017
+
+Bugfixes
+
+- Fixed monitor mode not working in combination with IPv6 (2.6.0 regression)
+
+## v.2.7.0 - 11 Mar, 2017
+
+Features
+
+- All returned errors are from now a subclass of `RedisError`.
+
+Bugfixes
+
+- Fixed rename_commands not accepting `null` as value
+- Fixed `AbortError`s and `AggregateError`s not showing the error message in the stack trace
+
+## v.2.6.5 - 15 Jan, 2017
+
+Bugfixes
+
+- Fixed parser not being reset in case the redis connection closed ASAP for overcoming of output buffer limits
+- Fixed parser reset if (p)message_buffer listener is attached
+
+## v.2.6.4 - 12 Jan, 2017
+
+Bugfixes
+
+- Fixed monitor mode not working in combination with IPv6, sockets or lua scripts (2.6.0 regression)
+
+## v.2.6.3 - 31 Oct, 2016
+
+Bugfixes
+
+- Do not change the tls setting to camel_case
+- Fix domain handling in combination with the offline queue (2.5.3 regression)
+
+## v.2.6.2 - 16 Jun, 2016
+
+Bugfixes
+
+- Fixed individual callbacks of a transaction not being called (2.6.0 regression)
+
+## v.2.6.1 - 02 Jun, 2016
+
+Bugfixes
+
+- Fixed invalid function name being exported
+
+## v.2.6.0 - 01 Jun, 2016
+
+In addition to the pre-releases the following changes exist in v.2.6.0:
+
+Features
+
+-  Updated [redis-parser](https://github.com/NodeRedis/node-redis-parser) dependency ([changelog](https://github.com/NodeRedis/node-redis-parser/releases/tag/v.2.0.0))
+ -  The JS parser is from now on the new default as it is a lot faster than the hiredis parser
+ -  This is no BC as there is no changed behavior for the user at all but just a performance improvement. Explicitly requireing the Hiredis parser is still possible.
+-  Added name property to all Redis functions (Node.js >= 4.0)
+-  Improved stack traces in development and debug mode
+
+Bugfixes
+
+-  Reverted support for `__proto__` (v.2.6.0-2) to prevent and breaking change
+
+Deprecations
+
+-  The `parser` option is deprecated and should be removed. The built-in Javascript parser is a lot faster than the hiredis parser and has more features
+
+## v.2.6.0-2 - 29 Apr, 2016
+
+Features
+
+-  Added support for the new [CLIENT REPLY ON|OFF|SKIP](http://redis.io/commands/client-reply) command (Redis v.3.2)
+-  Added support for camelCase
+ -  The Node.js landscape default is to use camelCase. node_redis is a bit out of the box here
+    but from now on it is possible to use both, just as you prefer!
+ -  If there's any documented variable missing as camelCased, please open a issue for it
+-  Improve error handling significantly
+ -  Only emit an error if the error has not already been handled in a callback
+ -  Improved unspecific error messages e.g. "Connection gone from end / close event"
+ -  Added `args` to command errors to improve identification of the error
+ -  Added origin to errors if there's e.g. a connection error
+ -  Added ReplyError class. All Redis errors are from now on going to be of that class
+ -  Added AbortError class. A subclass of AbortError. All unresolved and by node_redis rejected commands are from now on of that class
+ -  Added AggregateError class. If a unresolved and by node_redis rejected command has no callback and
+    this applies to more than a single command, the errors for the commands without callback are aggregated
+    to a single error that is emitted in debug_mode in that case.
+-  Added `message_buffer` / `pmessage_buffer` events. That event is always going to emit a buffer
+ -  Listening to the `message` event at the same time is always going to return the same message as string
+-  Added callback option to the duplicate function
+-  Added support for `__proto__` and other reserved keywords as hgetall field
+-  Updated [redis-commands](https://github.com/NodeRedis/redis-commands) dependency ([changelog](https://github.com/NodeRedis/redis-commands/releases/tag/v.1.2.0))
+
+Bugfixes
+
+-  Fixed v.2.5.0 auth command regression (under special circumstances a reconnect would not authenticate properly)
+-  Fixed v.2.6.0-0 pub sub mode and quit command regressions:
+ -  Entering pub sub mode not working if a earlier called and still running command returned an error
+ -  Unsubscribe callback not called if unsubscribing from all channels and resubscribing right away
+ -  Quit command resulting in an error in some cases
+-  Fixed special handled functions in batch and multi context not working the same as without (e.g. select and info)
+ -  Be aware that not all commands work in combination with transactions but they all work with batch
+-  Fixed address always set to 127.0.0.1:6379 in case host / port is set in the `tls` options instead of the general options
+
+## v.2.6.0-1 - 01 Apr, 2016
+
+A second pre-release with further fixes. This is likely going to be released as 2.6.0 stable without further changes.
+
+Features
+
+-  Added type validations for client.send_command arguments
+
+Bugfixes
+
+-  Fixed client.send_command not working properly with every command and every option
+-  Fixed pub sub mode unsubscribing from all channels in combination with the new `string_numbers` option crashing
+-  Fixed pub sub mode unsubscribing from all channels not respected while reconnecting
+-  Fixed pub sub mode events in combination with the `string_numbers` option emitting the number of channels not as number
+
+## v.2.6.0-0 - 27 Mar, 2016
+
+This is mainly a very important bug fix release with some smaller features.
+
+Features
+
+-  Monitor and pub sub mode now work together with the offline queue
+ -  All commands that were send after a connection loss are now going to be send after reconnecting
+-  Activating monitor mode does now work together with arbitrary commands including pub sub mode
+-  Pub sub mode is completely rewritten and all known issues fixed
+-  Added `string_numbers` option to get back strings instead of numbers
+-  Quit command is from now on always going to end the connection properly
+
+Bugfixes
+
+-  Fixed calling monitor command while other commands are still running
+-  Fixed monitor and pub sub mode not working together
+-  Fixed monitor mode not working in combination with the offline queue
+-  Fixed pub sub mode not working in combination with the offline queue
+-  Fixed pub sub mode resubscribing not working with non utf8 buffer channels
+-  Fixed pub sub mode crashing if calling unsubscribe / subscribe in various combinations
+-  Fixed pub sub mode emitting unsubscribe even if no channels were unsubscribed
+-  Fixed pub sub mode emitting a message without a message published
+-  Fixed quit command not ending the connection and resulting in further reconnection if called while reconnecting
+
+The quit command did not end connections earlier if the connection was down at that time and this could have
+lead to strange situations, therefor this was fixed to end the connection right away in those cases.
+
+## v.2.5.3 - 21 Mar, 2016
+
+Bugfixes
+
+-  Revert throwing on invalid data types and print a warning instead
+
+## v.2.5.2 - 16 Mar, 2016
+
+Bugfixes
+
+-  Fixed breaking changes against Redis 2.4 introduced in 2.5.0 / 2.5.1
+
+## v.2.5.1 - 15 Mar, 2016
+
+Bugfixes
+
+-  Fixed info command not working anymore with optional section argument
+
+## v.2.5.0 - 15 Mar, 2016
+
+Same changelog as the pre-release
+
+## v.2.5.0-1 - 07 Mar, 2016
+
+This is a big release with some substantial underlining changes. Therefor this is released as a pre-release and I encourage anyone who's able to, to test this out.
+
+It took way to long to release this one and the next release cycles will be shorter again.
+
+This release is also going to deprecate a couple things to prepare for a future v.3 (it'll still take a while to v.3).
+
+Features
+
+-  The parsers moved into the [redis-parser](https://github.com/NodeRedis/node-redis-parser) module and will be maintained in there from now on
+ -  Improve js parser speed significantly for big SUNION/SINTER/LRANGE/ZRANGE
+-  Improve redis-url parsing to also accept the database-number and options as query parameters as suggested in [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis)
+-  Added a `retry_unfulfilled_commands` option
+ -  Setting this to 'true' results in retrying all commands that were not fulfilled on a connection loss after the reconnect. Use with caution
+-  Added a `db` option to select the database while connecting (this is [not recommended](https://groups.google.com/forum/#!topic/redis-db/vS5wX8X4Cjg))
+-  Added a `password` option as alias for auth_pass
+-  The client.server_info is from now on updated while using the info command
+-  Gracefuly handle redis protocol errors from now on
+-  Added a `warning` emitter that receives node_redis warnings like auth not required and deprecation messages
+-  Added a `retry_strategy` option that replaces all reconnect options
+-  The reconnecting event from now on also receives:
+ -  The error message why the reconnect happened (params.error)
+ -  The amount of times the client was connected (params.times_connected)
+ -  The total reconnecting time since the last time connected (params.total_retry_time)
+-  Always respect the command execution order no matter if the reply could be returned sync or not (former exceptions: [#937](https://github.com/NodeRedis/node_redis/issues/937#issuecomment-167525939))
+-  redis.createClient is now checking input values stricter and detects more faulty input
+-  Started refactoring internals into individual modules
+-  Pipelining speed improvements
+
+Bugfixes
+
+-  Fixed explicit undefined as a command callback in a multi context
+-  Fixed hmset failing to detect the first key as buffer or date if the key is of that type
+-  Fixed do not run toString on an array argument and throw a "invalid data" error instead
+ -  This is not considered as breaking change, as this is likely a error in your code and if you want to have such a behavior you should handle this beforehand
+ -  The same applies to Map / Set and individual Object types
+-  Fixed redis url not accepting the protocol being omitted or protocols other than the redis protocol for convenience
+-  Fixed parsing the db keyspace even if the first database does not begin with a zero
+-  Fixed handling of errors occurring while receiving pub sub messages
+-  Fixed huge string pipelines crashing NodeJS (Pipeline size above 256mb)
+-  Fixed rename_commands and prefix option not working together
+-  Fixed ready being emitted to early in case a slave is still syncing / master down
+
+Deprecations
+
+-  Using any command with a argument being set to null or undefined is deprecated
+ -  From v.3.0.0 on using a command with such an argument will return an error instead
+ -  If you want to keep the old behavior please use a precheck in your code that converts the arguments to a string.
+ -  Using SET or SETEX with a undefined or null value will from now on also result in converting the value to "null" / "undefined" to have a consistent behavior. This is not considered as breaking change, as it returned an error earlier.
+-  Using .end(flush) without the flush parameter is deprecated and the flush parameter should explicitly be used
+ -  From v.3.0.0 on using .end without flush will result in an error
+ -  Using .end without flush means that any command that did not yet return is going to silently fail. Therefor this is considered harmful and you should explicitly silence such errors if you are sure you want this
+-  Depending on the return value of a command to detect the backpressure is deprecated
+ -  From version 3.0.0 on node_redis might not return true / false as a return value anymore. Please rely on client.should_buffer instead
+-  The `socket_nodelay` option is deprecated and will be removed in v.3.0.0
+ -  If you want to buffer commands you should use [.batch or .multi](./README.md) instead. This is necessary to reduce the amount of different options and this is very likely reducing your throughput if set to false.
+ -  If you are sure you want to activate the NAGLE algorithm you can still activate it by using client.stream.setNoDelay(false)
+-  The `max_attempts` option is deprecated and will be removed in v.3.0.0. Please use the `retry_strategy` instead
+-  The `retry_max_delay` option is deprecated and will be removed in v.3.0.0. Please use the `retry_strategy` instead
+-  The drain event is deprecated and will be removed in v.3.0.0. Please listen to the stream drain event instead
+-  The idle event is deprecated and will likely be removed in v.3.0.0. If you rely on this feature please open a new ticket in node_redis with your use case
+-  Redis < v. 2.6 is not officially supported anymore and might not work in all cases. Please update to a newer redis version as it is not possible to test for these old versions
+-  Removed non documented command syntax (adding the callback to an arguments array instead of passing it as individual argument)
+
+## v.2.4.2 - 27 Nov, 2015
+
+Bugfixes
+
+-  Fixed not emitting ready after reconnect with disable_resubscribing ([@maxgalbu](https://github.com/maxgalbu))
+
+## v.2.4.1 - 25 Nov, 2015
+
+Bugfixes
+
+-  Fixed a js parser regression introduced in 2.4.0 ([@BridgeAR](https://github.com/BridgeAR))
+
+## v.2.4.0 - 25 Nov, 2015
+
+Features
+
+-  Added `tls` option to initiate a connection to a redis server behind a TLS proxy. Thanks ([@paddybyers](https://github.com/paddybyers))
+-  Added `prefix` option to auto key prefix any command with the provided prefix ([@luin](https://github.com/luin) & [@BridgeAR](https://github.com/BridgeAR))
+-  Added `url` option to pass the connection url with the options object ([@BridgeAR](https://github.com/BridgeAR))
+-  Added `client.duplicate([options])` to duplicate the current client and return a new one with the same options ([@BridgeAR](https://github.com/BridgeAR))
+-  Improve performance by up to 20% on almost all use cases ([@BridgeAR](https://github.com/BridgeAR))
+
+Bugfixes
+
+-  Fixed js parser handling big values slow ([@BridgeAR](https://github.com/BridgeAR))
+ -  The speed is now on par with the hiredis parser.
+
+## v.2.3.1 - 18 Nov, 2015
+
+Bugfixes
+
+-  Fixed saving buffers with charsets other than utf-8 while using multi ([@BridgeAR](https://github.com/BridgeAR))
+-  Fixed js parser handling big values very slow ([@BridgeAR](https://github.com/BridgeAR))
+ -  The speed is up to ~500% faster than before but still up to ~50% slower than the hiredis parser.
+
+## v.2.3.0 - 30 Oct, 2015
+
+Features
+
+-  Improve speed further for: ([@BridgeAR](https://github.com/BridgeAR))
+ -  saving big strings (up to +300%)
+ -  using .multi / .batch (up to +50% / on Node.js 0.10.x +300%)
+ -  saving small buffers
+-  Increased coverage to 99% ([@BridgeAR](https://github.com/BridgeAR))
+-  Refactored manual backpressure control ([@BridgeAR](https://github.com/BridgeAR))
+ -  Removed the high water mark and low water mark. Such a mechanism should be implemented by a user instead
+ -  The `drain` event is from now on only emitted if the stream really had to buffer
+-  Reduced the default connect_timeout to be one hour instead of 24h ([@BridgeAR](https://github.com/BridgeAR))
+-  Added .path to redis.createClient(options); ([@BridgeAR](https://github.com/BridgeAR))
+-  Ignore info command, if not available on server ([@ivanB1975](https://github.com/ivanB1975))
+
+Bugfixes
+
+-  Fixed a js parser error that could result in a timeout ([@BridgeAR](https://github.com/BridgeAR))
+-  Fixed .multi / .batch used with Node.js 0.10.x not working properly after a reconnect ([@BridgeAR](https://github.com/BridgeAR))
+-  Fixed fired but not yet returned commands not being rejected after a connection loss ([@BridgeAR](https://github.com/BridgeAR))
+-  Fixed connect_timeout not respected if no connection has ever been established ([@gagle](https://github.com/gagle) & [@benjie](https://github.com/benjie))
+-  Fixed return_buffers in pub sub mode ([@komachi](https://github.com/komachi))
+
+## v.2.2.5 - 18 Oct, 2015
+
+Bugfixes
+
+-  Fixed undefined options passed to a new instance not accepted (possible with individual .createClient functions) ([@BridgeAR](https://github.com/BridgeAR))
+
+## v.2.2.4 - 17 Oct, 2015
+
+Bugfixes
+
+-  Fixed unspecific error message for unresolvable commands ([@BridgeAR](https://github.com/BridgeAR))
+-  Fixed not allowed command error in pubsub mode not being returned in a provided callback ([@BridgeAR](https://github.com/BridgeAR))
+-  Fixed to many commands forbidden in pub sub mode ([@BridgeAR](https://github.com/BridgeAR))
+-  Fixed mutation of the arguments array passed to .multi / .batch constructor ([@BridgeAR](https://github.com/BridgeAR))
+-  Fixed mutation of the options object passed to createClient ([@BridgeAR](https://github.com/BridgeAR))
+-  Fixed error callback in .multi not called if connection in broken mode ([@BridgeAR](https://github.com/BridgeAR))
+
+## v.2.2.3 - 14 Oct, 2015
+
+Bugfixes
+
+-  Fixed multi not being executed on Node 0.10.x if node_redis not yet ready ([@BridgeAR](https://github.com/BridgeAR))
+
+## v.2.2.2 - 14 Oct, 2015
+
+Bugfixes
+
+-  Fixed regular commands not being executed after a .multi until .exec was called ([@BridgeAR](https://github.com/BridgeAR))
+
+## v.2.2.1 - 12 Oct, 2015
+
+No code change
+
+## v.2.2.0 - 12 Oct, 2015 - The peregrino falcon
+
+The peregrino falcon is the fasted bird on earth and this is what this release is all about: Increased performance for heavy usage by up to **400%** [sic!] and increased overall performance for any command as well. Please check the benchmarks in the [README.md](README.md) for further details.
+
+Features
+
+-  Added rename_commands options to handle renamed commands from the redis config ([@digmxl](https://github.com/digmxl) & [@BridgeAR](https://github.com/BridgeAR))
+-  Added disable_resubscribing option to prevent a client from resubscribing after reconnecting ([@BridgeAR](https://github.com/BridgeAR))
+-  Increased performance ([@BridgeAR](https://github.com/BridgeAR))
+ -  exchanging built in queue with [@petkaantonov](https://github.com/petkaantonov)'s [double-ended queue](https://github.com/petkaantonov/deque)
+ -  prevent polymorphism
+ -  optimize statements
+-  Added *.batch* command, similar to .multi but without transaction ([@BridgeAR](https://github.com/BridgeAR))
+-  Improved pipelining to minimize the [RTT](http://redis.io/topics/pipelining) further ([@BridgeAR](https://github.com/BridgeAR))
+
+Bugfixes
+
+-  Fixed a javascript parser regression introduced in 2.0 that could result in timeouts on high load. ([@BridgeAR](https://github.com/BridgeAR))
+  - I was not able to write a regression test for this, since the error seems to only occur under heavy load with special conditions. So please have a look for timeouts with the js parser, if you use it and report all issues and switch to the hiredis parser in the meanwhile. If you're able to come up with a reproducable test case, this would be even better :)
+-  Fixed should_buffer boolean for .exec, .select and .auth commands not being returned and fix a couple special conditions ([@BridgeAR](https://github.com/BridgeAR))
+
+If you do not rely on transactions but want to reduce the RTT you can use .batch from now on. It'll behave just the same as .multi but it does not have any transaction and therefor won't roll back any failed commands.<br>
+Both .multi and .batch are from now on going to cache the commands and release them while calling .exec.
+
+Please consider using .batch instead of looping through a lot of commands one by one. This will significantly improve your performance.
+
+Here are some stats compared to ioredis 1.9.1 (Lenovo T450s i7-5600U):
+
+                      simple set
+          82,496 op/s » ioredis
+         112,617 op/s » node_redis
+
+                      simple get
+          82,015 op/s » ioredis
+         105,701 op/s » node_redis
+
+                      simple get with pipeline
+          10,233 op/s » ioredis
+          26,541 op/s » node_redis (using .batch)
+
+                      lrange 100
+           7,321 op/s » ioredis
+          26,155 op/s » node_redis
+
+                      publish
+          90,524 op/s » ioredis
+         112,823 op/s » node_redis
+
+                      subscribe
+          43,783 op/s » ioredis
+          61,889 op/s » node_redis
+
+To conclude: we can proudly say that node_redis is very likely outperforming any other node redis client.
+
+Known issues
+
+-  The pub sub system has some flaws and those will be addressed in the next minor release
+
+## v2.1.0 - Oct 02, 2015
+
+Features:
+
+-  Addded optional flush parameter to `.end`. If set to true, commands fired after using .end are going to be rejected instead of being ignored. (@crispy1989)
+-  Addded: host and port can now be provided in a single options object. E.g. redis.createClient({ host: 'localhost', port: 1337, max_attempts: 5 }); (@BridgeAR)
+-  Speedup common cases (@BridgeAR)
+
+Bugfixes:
+
+-  Fix argument mutation while using the array notation with the multi constructor (@BridgeAR)
+-  Fix multi.hmset key not being type converted if used with an object and key not being a string (@BridgeAR)
+-  Fix parser errors not being catched properly (@BridgeAR)
+-  Fix a crash that could occur if a redis server does not return the info command as usual #541 (@BridgeAR)
+-  Explicitly passing undefined as a callback statement will work again. E.g. client.publish('channel', 'message', undefined); (@BridgeAR)
+
+## v2.0.1 - Sep 24, 2015
+
+Bugfixes:
+
+-  Fix argument mutation while using the array notation in combination with keys / callbacks ([#866](.)). (@BridgeAR)
+
+## v2.0.0 - Sep 21, 2015
+
+This is the biggest release that node_redis had since it was released in 2010. A long list of outstanding bugs has been fixed, so we are very happy to present you redis 2.0 and we highly recommend updating as soon as possible.
+
+# What's new in 2.0
+
+- Implemented a "connection is broken" mode if no connection could be established
+- node_redis no longer throws under any circumstances, preventing it from terminating applications.
+- Multi error handling is now working properly
+- Consistent command behavior including multi
+- Windows support
+- Improved performance
+- A lot of code cleanup
+- Many bug fixes
+- Better user support!
+
+## Features:
+
+- Added a "redis connection is broken" mode after reaching max connection attempts / exceeding connection timeout. (@BridgeAR)
+- Added NODE_DEBUG=redis env to activate the debug_mode (@BridgeAR)
+- Added a default connection timeout of 24h instead of never timing out as a default (@BridgeAR)
+- Added: Network errors and other stream errors will from now on include the error code as `err.code` property (@BridgeAR)
+- Added: Errors thrown by redis will now include the redis error code as `err.code` property. (@skeggse & @BridgeAR)
+- Added: Errors thrown by node_redis will now include a `err.command` property for the command used (@BridgeAR)
+- Added new commands and drop support for deprecated *substr* (@BridgeAR)
+- Added new possibilities how to provide the command arguments (@BridgeAR)
+- The entries in the keyspace of the server_info is now an object instead of a string. (@SinisterLight & @BridgeAR)
+- Small speedup here and there (e.g. by not using .toLowerCase() anymore) (@BridgeAR)
+- Full windows support (@bcoe)
+- Increased coverage by 10% and add a lot of tests to make sure everything works as it should. We now reached 97% :-) (@BridgeAR)
+- Remove dead code, clean up and refactor very old chunks (@BridgeAR)
+- Don't flush the offline queue if reconnecting (@BridgeAR)
+- Emit all errors insteaf of throwing sometimes and sometimes emitting them (@BridgeAR)
+- *auth_pass* passwords are now checked to be a valid password (@jcppman & @BridgeAR)
+
+## Bug fixes:
+
+- Don't kill the app anymore by randomly throwing errors sync instead of emitting them (@BridgeAR)
+- Don't catch user errors anymore occuring in callbacks (no try callback anymore & more fixes for the parser) (@BridgeAR)
+- Early garbage collection of queued items (@dohse)
+- Fix js parser returning errors as strings (@BridgeAR)
+- Do not wrap errors into other errors (@BridgeAR)
+- Authentication failures are now returned in the callback instead of being emitted (@BridgeAR)
+- Fix a memory leak on reconnect (@rahar)
+- Using `send_command` directly may now also be called without the args as stated in the [README.md](./README.md) (@BridgeAR)
+- Fix the multi.exec error handling (@BridgeAR)
+- Fix commands being inconsistent and behaving wrong (@BridgeAR)
+- Channel names with spaces are now properly resubscribed after a reconnection (@pbihler)
+- Do not try to reconnect after the connection timeout has been exceeded (@BridgeAR)
+- Ensure the execution order is observed if using .eval (@BridgeAR)
+- Fix commands not being rejected after calling .quit (@BridgeAR)
+- Fix .auth calling the callback twice if already connected (@BridgeAR)
+- Fix detect_buffers not working in pub sub mode and while monitoring (@BridgeAR)
+- Fix channel names always being strings instead of buffers while return_buffers is true (@BridgeAR)
+- Don't print any debug statements if not asked for (@BridgeAR)
+- Fix a couple small other bugs
+
+## Breaking changes:
+
+1. redis.send_command commands have to be lower case from now on. This does only apply if you use `.send_command` directly instead of the convenient methods like `redis.command`.
+2. Error messages have changed quite a bit. If you depend on a specific wording please check your application carfully.
+3. Errors are from now on always either returned if a callback is present or emitted. They won't be thrown (neither sync, nor async).
+4. The Multi error handling has changed a lot!
+ - All errors are from now on errors instead of strings (this only applied to the js parser).
+ - If an error occurs while queueing the commands an EXECABORT error will be returned including the failed commands as `.errors` property instead of an array with errors.
+ - If an error occurs while executing the commands and that command has a callback it'll return the error as first parameter (`err, undefined` instead of `null, undefined`).
+ - All the errors occuring while executing the commands will stay in the result value as error instance (if you used the js parser before they would have been strings). Be aware that the transaction won't be aborted if those error occurr!
+ - If `multi.exec` does not have a callback and an EXECABORT error occurrs, it'll emit that error instead.
+5. If redis can't connect to your redis server it'll give up after a certain point of failures (either max connection attempts or connection timeout exceeded). If that is the case it'll emit an CONNECTION_BROKEN error. You'll have to initiate a new client to try again afterwards.
+6. The offline queue is not flushed anymore on a reconnect. It'll stay until node_redis gives up trying to reach the server or until you close the connection.
+7. Before this release node_redis catched user errors and threw them async back. This is not the case anymore! No user behavior of what so ever will be tracked or catched.
+8. The keyspace of `redis.server_info` (db0...) is from now on an object instead of an string.
+
+NodeRedis also thanks @qdb, @tobek, @cvibhagool, @frewsxcv, @davidbanham, @serv, @vitaliylag, @chrishamant, @GamingCoder and all other contributors that I may have missed for their contributions!
+
+From now on we'll push new releases more frequently out and fix further long outstanding things and implement new features.
+
+<hr>
+
+## v1.0.0 - Aug 30, 2015
+
+* Huge issue and pull-request cleanup. Thanks Blain! (@blainsmith)
+* [#658](https://github.com/NodeRedis/node_redis/pull/658) Client now parses URL-format connection strings (e.g., redis://foo:pass@127.0.0.1:8080) (@kuwabarahiroshi)
+* [#749](https://github.com/NodeRedis/node_redis/pull/749) Fix reconnection bug when client is in monitoring mode (@danielbprice)
+* [#786](https://github.com/NodeRedis/node_redis/pull/786) Refactor createClient. Fixes #651 (@BridgeAR)
+* [#793](https://github.com/NodeRedis/node_redis/pull/793) Refactor tests and improve test coverage (@erinspice, @bcoe)
+* [#733](https://github.com/NodeRedis/node_redis/pull/733) Fixes detect_buffers functionality in the context of exec. Fixes #732, #263 (@raydog)
+* [#785](https://github.com/NodeRedis/node_redis/pull/785) Tiny speedup by using 'use strict' (@BridgeAR)
+* Fix extraneous error output due to pubsub tests (Mikael Kohlmyr)
+
+## v0.12.1 - Aug 10, 2014
+* Fix IPv6/IPv4 family selection in node 0.11+ (Various)
+
+## v0.12.0 - Aug 9, 2014
+* Fix unix socket support (Jack Tang)
+* Improve createClient argument handling (Jack Tang)
+
+## v0.11.0 - Jul 10, 2014
+
+* IPv6 Support. (Yann Stephan)
+* Revert error emitting and go back to throwing errors. (Bryce Baril)
+* Set socket_keepalive to prevent long-lived client timeouts. (mohit)
+* Correctly reset retry timer. (ouotuo)
+* Domains protection from bad user exit. (Jake Verbaten)
+* Fix reconnection socket logic to prevent misqueued entries. (Iain Proctor)
+
+## v0.10.3 - May 22, 2014
+
+* Update command list to match Redis 2.8.9 (Charles Feng)
+
+## v0.10.2 - May 18, 2014
+
+* Better binary key handling for HGETALL. (Nick Apperson)
+* Fix test not resetting `error` handler. (CrypticSwarm)
+* Fix SELECT error semantics. (Bryan English)
+
+## v0.10.1 - February 17, 2014
+
+* Skip plucking redis version from the INFO stream if INFO results weren't provided. (Robert Sköld)
+
+## v0.10.0 - December 21, 2013
+
+* Instead of throwing errors asynchronously, emit errors on client. (Bryce Baril)
+
+## v0.9.2 - December 15, 2013
+
+* Regenerate commands for new 2.8.x Redis commands. (Marek Ventur)
+* Correctly time reconnect counts when using 'auth'. (William Hockey)
+
+## v0.9.1 - November 23, 2013
+
+* Allow hmset to accept numeric keys. (Alex Stokes)
+* Fix TypeError for multiple MULTI/EXEC errors. (Kwangsu Kim)
+
+## v0.9.0 - October 17, 2013
+
+* Domains support. (Forrest L Norvell)
+
+## v0.8.6 - October 2, 2013
+
+* If error is already an Error, don't wrap it in another Error. (Mathieu M-Gosselin)
+* Fix retry delay logic (Ian Babrou)
+* Return Errors instead of strings where Errors are expected (Ian Babrou)
+* Add experimental `.unref()` method to RedisClient (Bryce Baril / Olivier Lalonde)
+* Strengthen checking of reply to prevent conflating "message" or "pmessage" fields with pub_sub replies. (Bryce Baril)
+
+## v0.8.5 - September 26, 2013
+
+* Add `auth_pass` option to connect and immediately authenticate (Henrik Peinar)
+
+## v0.8.4 - June 24, 2013
+
+Many contributed features and fixes, including:
+* Ignore password set if not needed. (jbergknoff)
+* Improved compatibility with 0.10.X for tests and client.end() (Bryce Baril)
+* Protect connection retries from application exceptions. (Amos Barreto)
+* Better exception handling for Multi/Exec (Thanasis Polychronakis)
+* Renamed pubsub mode to subscriber mode (Luke Plaster)
+* Treat SREM like SADD when passed an array (Martin Ciparelli)
+* Fix empty unsub/punsub TypeError (Jeff Barczewski)
+* Only attempt to run a callback if it one was provided (jifeng)
+
+## v0.8.3 - April 09, 2013
+
+Many contributed features and fixes, including:
+* Fix some tests for Node.js version 0.9.x+ changes (Roman Ivanilov)
+* Fix error when commands submitted after idle event handler (roamm)
+* Bypass Redis for no-op SET/SETEX commands (jifeng)
+* Fix HMGET + detect_buffers (Joffrey F)
+* Fix CLIENT LOAD functionality (Jonas Dohse)
+* Add percentage outputs to diff_multi_bench_output.js (Bryce Baril)
+* Add retry_max_delay option (Tomasz Durka)
+* Fix parser off-by-one errors with nested multi-bulk replies (Bryce Baril)
+* Prevent parser from sinking application-side exceptions (Bryce Baril)
+* Fix parser incorrect buffer skip when parsing multi-bulk errors (Bryce Baril)
+* Reverted previous change with throwing on non-string values with HMSET (David Trejo)
+* Fix command queue sync issue when using pubsub (Tom Leach)
+* Fix compatibility with two-word Redis commands (Jonas Dohse)
+* Add EVAL with array syntax (dmoena)
+* Fix tests due to Redis reply order changes in 2.6.5+ (Bryce Baril)
+* Added a test for the SLOWLOG command (Nitesh Sinha)
+* Fix SMEMBERS order dependency in test broken by Redis changes (Garrett Johnson)
+* Update commands for new Redis commands (David Trejo)
+* Prevent exception from SELECT on subscriber reconnection (roamm)
+
+
+## v0.8.2 - November 11, 2012
+
+Another version bump because 0.8.1 didn't get applied properly for some mysterious reason.
+Sorry about that.
+
+Changed name of "faster" parser to "javascript".
+
+## v0.8.1 - September 11, 2012
+
+Important bug fix for null responses (Jerry Sievert)
+
+## v0.8.0 - September 10, 2012
+
+Many contributed features and fixes, including:
+
+* Pure JavaScript reply parser that is usually faster than hiredis (Jerry Sievert)
+* Remove hiredis as optionalDependency from package.json. It still works if you want it.
+* Restore client state on reconnect, including select, subscribe, and monitor. (Ignacio Burgueño)
+* Fix idle event (Trae Robrock)
+* Many documentation improvements and bug fixes (David Trejo)
+
+## v0.7.2 - April 29, 2012
+
+Many contributed fixes. Thank you, contributors.
+
+* [GH-190] - pub/sub mode fix (Brian Noguchi)
+* [GH-165] - parser selection fix (TEHEK)
+* numerous documentation and examples updates
+* auth errors emit Errors instead of Strings (David Trejo)
+
+## v0.7.1 - November 15, 2011
+
+Fix regression in reconnect logic.
+
+Very much need automated tests for reconnection and queue logic.
+
+## v0.7.0 - November 14, 2011
+
+Many contributed fixes. Thanks everybody.
+
+* [GH-127] - properly re-initialize parser on reconnect
+* [GH-136] - handle passing undefined as callback (Ian Babrou)
+* [GH-139] - properly handle exceptions thrown in pub/sub event handlers (Felix Geisendörfer)
+* [GH-141] - detect closing state on stream error (Felix Geisendörfer)
+* [GH-142] - re-select database on reconnection (Jean-Hugues Pinson)
+* [GH-146] - add sort example (Maksim Lin)
+
+Some more goodies:
+
+* Fix bugs with node 0.6
+* Performance improvements
+* New version of `multi_bench.js` that tests more realistic scenarios
+* [GH-140] - support optional callback for subscribe commands
+* Properly flush and error out command queue when connection fails
+* Initial work on reconnection thresholds
+
+## v0.6.7 - July 30, 2011
+
+(accidentally skipped v0.6.6)
+
+Fix and test for [GH-123]
+
+Passing an Array as as the last argument should expand as users
+expect.  The old behavior was to coerce the arguments into Strings,
+which did surprising things with Arrays.
+
+## v0.6.5 - July 6, 2011
+
+Contributed changes:
+
+*  Support SlowBuffers (Umair Siddique)
+*  Add Multi to exports (Louis-Philippe Perron)
+*  Fix for drain event calculation (Vladimir Dronnikov)
+
+Thanks!
+
+## v0.6.4 - June 30, 2011
+
+Fix bug with optional callbacks for hmset.
+
+## v0.6.2 - June 30, 2011
+
+Bugs fixed:
+
+*  authentication retry while server is loading db (danmaz74) [GH-101]
+*  command arguments processing issue with arrays
+
+New features:
+
+*  Auto update of new commands from redis.io (Dave Hoover)
+*  Performance improvements and backpressure controls.
+*  Commands now return the true/false value from the underlying socket write(s).
+*  Implement command_queue high water and low water for more better control of queueing.
+
+See `examples/backpressure_drain.js` for more information.
+
+## v0.6.1 - June 29, 2011
+
+Add support and tests for Redis scripting through EXEC command.
+
+Bug fix for monitor mode.  (forddg)
+
+Auto update of new commands from redis.io (Dave Hoover)
+
+## v0.6.0 - April 21, 2011
+
+Lots of bugs fixed.
+
+*  connection error did not properly trigger reconnection logic [GH-85]
+*  client.hmget(key, [val1, val2]) was not expanding properly [GH-66]
+*  client.quit() while in pub/sub mode would throw an error [GH-87]
+*  client.multi(['hmset', 'key', {foo: 'bar'}]) fails [GH-92]
+*  unsubscribe before subscribe would make things very confused [GH-88]
+*  Add BRPOPLPUSH [GH-79]
+
+## v0.5.11 - April 7, 2011
+
+Added DISCARD
+
+I originally didn't think DISCARD would do anything here because of the clever MULTI interface, but somebody
+pointed out to me that DISCARD can be used to flush the WATCH set.
+
+## v0.5.10 - April 6, 2011
+
+Added HVALS
+
+## v0.5.9 - March 14, 2011
+
+Fix bug with empty Array arguments - Andy Ray
+
+## v0.5.8 - March 14, 2011
+
+Add `MONITOR` command and special monitor command reply parsing.
+
+## v0.5.7 - February 27, 2011
+
+Add magical auth command.
+
+Authentication is now remembered by the client and will be automatically sent to the server
+on every connection, including any reconnections.
+
+## v0.5.6 - February 22, 2011
+
+Fix bug in ready check with `return_buffers` set to `true`.
+
+Thanks to Dean Mao and Austin Chau.
+
+## v0.5.5 - February 16, 2011
+
+Add probe for server readiness.
+
+When a Redis server starts up, it might take a while to load the dataset into memory.
+During this time, the server will accept connections, but will return errors for all non-INFO
+commands.  Now node_redis will send an INFO command whenever it connects to a server.
+If the info command indicates that the server is not ready, the client will keep trying until
+the server is ready.  Once it is ready, the client will emit a "ready" event as well as the
+"connect" event.  The client will queue up all commands sent before the server is ready, just
+like it did before.  When the server is ready, all offline/non-ready commands will be replayed.
+This should be backward compatible with previous versions.
+
+To disable this ready check behavior, set `options.no_ready_check` when creating the client.
+
+As a side effect of this change, the key/val params from the info command are available as
+`client.server_options`.  Further, the version string is decomposed into individual elements
+in `client.server_options.versions`.
+
+## v0.5.4 - February 11, 2011
+
+Fix excess memory consumption from Queue backing store.
+
+Thanks to Gustaf Sjöberg.
+
+## v0.5.3 - February 5, 2011
+
+Fix multi/exec error reply callback logic.
+
+Thanks to Stella Laurenzo.
+
+## v0.5.2 - January 18, 2011
+
+Fix bug where unhandled error replies confuse the parser.
+
+## v0.5.1 - January 18, 2011
+
+Fix bug where subscribe commands would not handle redis-server startup error properly.
+
+## v0.5.0 - December 29, 2010
+
+Some bug fixes:
+
+* An important bug fix in reconnection logic.  Previously, reply callbacks would be invoked twice after
+  a reconnect.
+* Changed error callback argument to be an actual Error object.
+
+New feature:
+
+* Add friendly syntax for HMSET using an object.
+
+## v0.4.1 - December 8, 2010
+
+Remove warning about missing hiredis.  You probably do want it though.
+
+## v0.4.0 - December 5, 2010
+
+Support for multiple response parsers and hiredis C library from Pieter Noordhuis.
+Return Strings instead of Buffers by default.
+Empty nested mb reply bug fix.
+
+## v0.3.9 - November 30, 2010
+
+Fix parser bug on failed EXECs.
+
+## v0.3.8 - November 10, 2010
+
+Fix for null MULTI response when WATCH condition fails.
+
+## v0.3.7 - November 9, 2010
+
+Add "drain" and "idle" events.
+
+## v0.3.6 - November 3, 2010
+
+Add all known Redis commands from Redis master, even ones that are coming in 2.2 and beyond.
+
+Send a friendlier "error" event message on stream errors like connection refused / reset.
+
+## v0.3.5 - October 21, 2010
+
+A few bug fixes.
+
+* Fixed bug with `nil` multi-bulk reply lengths that showed up with `BLPOP` timeouts.
+* Only emit `end` once when connection goes away.
+* Fixed bug in `test.js` where driver finished before all tests completed.
+
+## unversioned wasteland
+
+See the git history for what happened before.
diff --git a/node_modules/redis/index.js b/node_modules/redis/index.js
new file mode 100644
index 0000000..58fcf84
--- /dev/null
+++ b/node_modules/redis/index.js
@@ -0,0 +1,1105 @@
+'use strict';
+
+var net = require('net');
+var tls = require('tls');
+var util = require('util');
+var utils = require('./lib/utils');
+var Command = require('./lib/command');
+var Queue = require('double-ended-queue');
+var errorClasses = require('./lib/customErrors');
+var EventEmitter = require('events');
+var Parser = require('redis-parser');
+var commands = require('redis-commands');
+var debug = require('./lib/debug');
+var unifyOptions = require('./lib/createClient');
+var SUBSCRIBE_COMMANDS = {
+    subscribe: true,
+    unsubscribe: true,
+    psubscribe: true,
+    punsubscribe: true
+};
+
+// Newer Node.js versions > 0.10 return the EventEmitter right away and using .EventEmitter was deprecated
+if (typeof EventEmitter !== 'function') {
+    EventEmitter = EventEmitter.EventEmitter;
+}
+
+function noop () {}
+
+function handle_detect_buffers_reply (reply, command, buffer_args) {
+    if (buffer_args === false || this.message_buffers) {
+        // If detect_buffers option was specified, then the reply from the parser will be a buffer.
+        // If this command did not use Buffer arguments, then convert the reply to Strings here.
+        reply = utils.reply_to_strings(reply);
+    }
+
+    if (command === 'hgetall') {
+        reply = utils.reply_to_object(reply);
+    }
+    return reply;
+}
+
+exports.debug_mode = /\bredis\b/i.test(process.env.NODE_DEBUG);
+
+// Attention: The second parameter might be removed at will and is not officially supported.
+// Do not rely on this
+function RedisClient (options, stream) {
+    // Copy the options so they are not mutated
+    options = utils.clone(options);
+    EventEmitter.call(this);
+    var cnx_options = {};
+    var self = this;
+    /* istanbul ignore next: travis does not work with stunnel atm. Therefore the tls tests are skipped on travis */
+    for (var tls_option in options.tls) {
+        cnx_options[tls_option] = options.tls[tls_option];
+        // Copy the tls options into the general options to make sure the address is set right
+        if (tls_option === 'port' || tls_option === 'host' || tls_option === 'path' || tls_option === 'family') {
+            options[tls_option] = options.tls[tls_option];
+        }
+    }
+    if (stream) {
+        // The stream from the outside is used so no connection from this side is triggered but from the server this client should talk to
+        // Reconnect etc won't work with this. This requires monkey patching to work, so it is not officially supported
+        options.stream = stream;
+        this.address = '"Private stream"';
+    } else if (options.path) {
+        cnx_options.path = options.path;
+        this.address = options.path;
+    } else {
+        cnx_options.port = +options.port || 6379;
+        cnx_options.host = options.host || '127.0.0.1';
+        cnx_options.family = (!options.family && net.isIP(cnx_options.host)) || (options.family === 'IPv6' ? 6 : 4);
+        this.address = cnx_options.host + ':' + cnx_options.port;
+    }
+    // Warn on misusing deprecated functions
+    if (typeof options.retry_strategy === 'function') {
+        if ('max_attempts' in options) {
+            self.warn('WARNING: You activated the retry_strategy and max_attempts at the same time. This is not possible and max_attempts will be ignored.');
+            // Do not print deprecation warnings twice
+            delete options.max_attempts;
+        }
+        if ('retry_max_delay' in options) {
+            self.warn('WARNING: You activated the retry_strategy and retry_max_delay at the same time. This is not possible and retry_max_delay will be ignored.');
+            // Do not print deprecation warnings twice
+            delete options.retry_max_delay;
+        }
+    }
+
+    this.connection_options = cnx_options;
+    this.connection_id = RedisClient.connection_id++;
+    this.connected = false;
+    this.ready = false;
+    if (options.socket_nodelay === undefined) {
+        options.socket_nodelay = true;
+    } else if (!options.socket_nodelay) { // Only warn users with this set to false
+        self.warn(
+            'socket_nodelay is deprecated and will be removed in v.3.0.0.\n' +
+            'Setting socket_nodelay to false likely results in a reduced throughput. Please use .batch for pipelining instead.\n' +
+            'If you are sure you rely on the NAGLE-algorithm you can activate it by calling client.stream.setNoDelay(false) instead.'
+        );
+    }
+    if (options.socket_keepalive === undefined) {
+        options.socket_keepalive = true;
+    }
+    for (var command in options.rename_commands) {
+        options.rename_commands[command.toLowerCase()] = options.rename_commands[command];
+    }
+    options.return_buffers = !!options.return_buffers;
+    options.detect_buffers = !!options.detect_buffers;
+    // Override the detect_buffers setting if return_buffers is active and print a warning
+    if (options.return_buffers && options.detect_buffers) {
+        self.warn('WARNING: You activated return_buffers and detect_buffers at the same time. The return value is always going to be a buffer.');
+        options.detect_buffers = false;
+    }
+    if (options.detect_buffers) {
+        // We only need to look at the arguments if we do not know what we have to return
+        this.handle_reply = handle_detect_buffers_reply;
+    }
+    this.should_buffer = false;
+    this.max_attempts = options.max_attempts | 0;
+    if ('max_attempts' in options) {
+        self.warn(
+            'max_attempts is deprecated and will be removed in v.3.0.0.\n' +
+            'To reduce the number of options and to improve the reconnection handling please use the new `retry_strategy` option instead.\n' +
+            'This replaces the max_attempts and retry_max_delay option.'
+        );
+    }
+    this.command_queue = new Queue(); // Holds sent commands to de-pipeline them
+    this.offline_queue = new Queue(); // Holds commands issued but not able to be sent
+    this.pipeline_queue = new Queue(); // Holds all pipelined commands
+    // ATTENTION: connect_timeout should change in v.3.0 so it does not count towards ending reconnection attempts after x seconds
+    // This should be done by the retry_strategy. Instead it should only be the timeout for connecting to redis
+    this.connect_timeout = +options.connect_timeout || 3600000; // 60 * 60 * 1000 ms
+    this.enable_offline_queue = options.enable_offline_queue === false ? false : true;
+    this.retry_max_delay = +options.retry_max_delay || null;
+    if ('retry_max_delay' in options) {
+        self.warn(
+            'retry_max_delay is deprecated and will be removed in v.3.0.0.\n' +
+            'To reduce the amount of options and the improve the reconnection handling please use the new `retry_strategy` option instead.\n' +
+            'This replaces the max_attempts and retry_max_delay option.'
+        );
+    }
+    this.initialize_retry_vars();
+    this.pub_sub_mode = 0;
+    this.subscription_set = {};
+    this.monitoring = false;
+    this.message_buffers = false;
+    this.closing = false;
+    this.server_info = {};
+    this.auth_pass = options.auth_pass || options.password;
+    this.selected_db = options.db; // Save the selected db here, used when reconnecting
+    this.old_state = null;
+    this.fire_strings = true; // Determine if strings or buffers should be written to the stream
+    this.pipeline = false;
+    this.sub_commands_left = 0;
+    this.times_connected = 0;
+    this.buffers = options.return_buffers || options.detect_buffers;
+    this.options = options;
+    this.reply = 'ON'; // Returning replies is the default
+    this.create_stream();
+    // The listeners will not be attached right away, so let's print the deprecation message while the listener is attached
+    this.on('newListener', function (event) {
+        if (event === 'idle') {
+            this.warn(
+                'The idle event listener is deprecated and will likely be removed in v.3.0.0.\n' +
+                'If you rely on this feature please open a new ticket in node_redis with your use case'
+            );
+        } else if (event === 'drain') {
+            this.warn(
+                'The drain event listener is deprecated and will be removed in v.3.0.0.\n' +
+                'If you want to keep on listening to this event please listen to the stream drain event directly.'
+            );
+        } else if ((event === 'message_buffer' || event === 'pmessage_buffer' || event === 'messageBuffer' || event === 'pmessageBuffer') && !this.buffers && !this.message_buffers) {
+            if (this.reply_parser.name !== 'javascript') {
+                return this.warn(
+                    'You attached the "' + event + '" listener without the returnBuffers option set to true.\n' +
+                    'Please use the JavaScript parser or set the returnBuffers option to true to return buffers.'
+                );
+            }
+            this.reply_parser.optionReturnBuffers = true;
+            this.message_buffers = true;
+            this.handle_reply = handle_detect_buffers_reply;
+        }
+    });
+}
+util.inherits(RedisClient, EventEmitter);
+
+RedisClient.connection_id = 0;
+
+function create_parser (self) {
+    return new Parser({
+        returnReply: function (data) {
+            self.return_reply(data);
+        },
+        returnError: function (err) {
+            // Return a ReplyError to indicate Redis returned an error
+            self.return_error(err);
+        },
+        returnFatalError: function (err) {
+            // Error out all fired commands. Otherwise they might rely on faulty data. We have to reconnect to get in a working state again
+            // Note: the execution order is important. First flush and emit, then create the stream
+            err.message += '. Please report this.';
+            self.ready = false;
+            self.flush_and_error({
+                message: 'Fatal error encountert. Command aborted.',
+                code: 'NR_FATAL'
+            }, {
+                error: err,
+                queues: ['command_queue']
+            });
+            self.emit('error', err);
+            self.create_stream();
+        },
+        returnBuffers: self.buffers || self.message_buffers,
+        name: self.options.parser || 'javascript',
+        stringNumbers: self.options.string_numbers || false
+    });
+}
+
+/******************************************************************************
+
+    All functions in here are internal besides the RedisClient constructor
+    and the exported functions. Don't rely on them as they will be private
+    functions in node_redis v.3
+
+******************************************************************************/
+
+// Attention: the function name "create_stream" should not be changed, as other libraries need this to mock the stream (e.g. fakeredis)
+RedisClient.prototype.create_stream = function () {
+    var self = this;
+
+    // Init parser
+    this.reply_parser = create_parser(this);
+
+    if (this.options.stream) {
+        // Only add the listeners once in case of a reconnect try (that won't work)
+        if (this.stream) {
+            return;
+        }
+        this.stream = this.options.stream;
+    } else {
+        // On a reconnect destroy the former stream and retry
+        if (this.stream) {
+            this.stream.removeAllListeners();
+            this.stream.destroy();
+        }
+
+        /* istanbul ignore if: travis does not work with stunnel atm. Therefore the tls tests are skipped on travis */
+        if (this.options.tls) {
+            this.stream = tls.connect(this.connection_options);
+        } else {
+            this.stream = net.createConnection(this.connection_options);
+        }
+    }
+
+    if (this.options.connect_timeout) {
+        this.stream.setTimeout(this.connect_timeout, function () {
+            // Note: This is only tested if a internet connection is established
+            self.retry_totaltime = self.connect_timeout;
+            self.connection_gone('timeout');
+        });
+    }
+
+    /* istanbul ignore next: travis does not work with stunnel atm. Therefore the tls tests are skipped on travis */
+    var connect_event = this.options.tls ? 'secureConnect' : 'connect';
+    this.stream.once(connect_event, function () {
+        this.removeAllListeners('timeout');
+        self.times_connected++;
+        self.on_connect();
+    });
+
+    this.stream.on('data', function (buffer_from_socket) {
+        // The buffer_from_socket.toString() has a significant impact on big chunks and therefore this should only be used if necessary
+        debug('Net read ' + self.address + ' id ' + self.connection_id); // + ': ' + buffer_from_socket.toString());
+        self.reply_parser.execute(buffer_from_socket);
+        self.emit_idle();
+    });
+
+    this.stream.on('error', function (err) {
+        self.on_error(err);
+    });
+
+    /* istanbul ignore next: difficult to test and not important as long as we keep this listener */
+    this.stream.on('clientError', function (err) {
+        debug('clientError occured');
+        self.on_error(err);
+    });
+
+    this.stream.once('close', function (hadError) {
+        self.connection_gone('close');
+    });
+
+    this.stream.once('end', function () {
+        self.connection_gone('end');
+    });
+
+    this.stream.on('drain', function () {
+        self.drain();
+    });
+
+    if (this.options.socket_nodelay) {
+        this.stream.setNoDelay();
+    }
+
+    // Fire the command before redis is connected to be sure it's the first fired command
+    if (this.auth_pass !== undefined) {
+        this.ready = true;
+        // Fail silently as we might not be able to connect
+        this.auth(this.auth_pass, function (err) {
+            if (err && err.code !== 'UNCERTAIN_STATE') {
+                self.emit('error', err);
+            }
+        });
+        this.ready = false;
+    }
+};
+
+RedisClient.prototype.handle_reply = function (reply, command) {
+    if (command === 'hgetall') {
+        reply = utils.reply_to_object(reply);
+    }
+    return reply;
+};
+
+RedisClient.prototype.cork = noop;
+RedisClient.prototype.uncork = noop;
+
+RedisClient.prototype.initialize_retry_vars = function () {
+    this.retry_timer = null;
+    this.retry_totaltime = 0;
+    this.retry_delay = 200;
+    this.retry_backoff = 1.7;
+    this.attempts = 1;
+};
+
+RedisClient.prototype.warn = function (msg) {
+    var self = this;
+    // Warn on the next tick. Otherwise no event listener can be added
+    // for warnings that are emitted in the redis client constructor
+    process.nextTick(function () {
+        if (self.listeners('warning').length !== 0) {
+            self.emit('warning', msg);
+        } else {
+            console.warn('node_redis:', msg);
+        }
+    });
+};
+
+// Flush provided queues, erroring any items with a callback first
+RedisClient.prototype.flush_and_error = function (error_attributes, options) {
+    options = options || {};
+    var aggregated_errors = [];
+    var queue_names = options.queues || ['command_queue', 'offline_queue']; // Flush the command_queue first to keep the order intakt
+    for (var i = 0; i < queue_names.length; i++) {
+        // If the command was fired it might have been processed so far
+        if (queue_names[i] === 'command_queue') {
+            error_attributes.message += ' It might have been processed.';
+        } else { // As the command_queue is flushed first, remove this for the offline queue
+            error_attributes.message = error_attributes.message.replace(' It might have been processed.', '');
+        }
+        // Don't flush everything from the queue
+        for (var command_obj = this[queue_names[i]].shift(); command_obj; command_obj = this[queue_names[i]].shift()) {
+            var err = new errorClasses.AbortError(error_attributes);
+            if (command_obj.error) {
+                err.stack = err.stack + command_obj.error.stack.replace(/^Error.*?\n/, '\n');
+            }
+            err.command = command_obj.command.toUpperCase();
+            if (command_obj.args && command_obj.args.length) {
+                err.args = command_obj.args;
+            }
+            if (options.error) {
+                err.origin = options.error;
+            }
+            if (typeof command_obj.callback === 'function') {
+                command_obj.callback(err);
+            } else {
+                aggregated_errors.push(err);
+            }
+        }
+    }
+    // Currently this would be a breaking change, therefore it's only emitted in debug_mode
+    if (exports.debug_mode && aggregated_errors.length) {
+        var error;
+        if (aggregated_errors.length === 1) {
+            error = aggregated_errors[0];
+        } else {
+            error_attributes.message = error_attributes.message.replace('It', 'They').replace(/command/i, '$&s');
+            error = new errorClasses.AggregateError(error_attributes);
+            error.errors = aggregated_errors;
+        }
+        this.emit('error', error);
+    }
+};
+
+RedisClient.prototype.on_error = function (err) {
+    if (this.closing) {
+        return;
+    }
+
+    err.message = 'Redis connection to ' + this.address + ' failed - ' + err.message;
+    debug(err.message);
+    this.connected = false;
+    this.ready = false;
+
+    // Only emit the error if the retry_stategy option is not set
+    if (!this.options.retry_strategy) {
+        this.emit('error', err);
+    }
+    // 'error' events get turned into exceptions if they aren't listened for. If the user handled this error
+    // then we should try to reconnect.
+    this.connection_gone('error', err);
+};
+
+RedisClient.prototype.on_connect = function () {
+    debug('Stream connected ' + this.address + ' id ' + this.connection_id);
+
+    this.connected = true;
+    this.ready = false;
+    this.emitted_end = false;
+    this.stream.setKeepAlive(this.options.socket_keepalive);
+    this.stream.setTimeout(0);
+
+    this.emit('connect');
+    this.initialize_retry_vars();
+
+    if (this.options.no_ready_check) {
+        this.on_ready();
+    } else {
+        this.ready_check();
+    }
+};
+
+RedisClient.prototype.on_ready = function () {
+    var self = this;
+
+    debug('on_ready called ' + this.address + ' id ' + this.connection_id);
+    this.ready = true;
+
+    this.cork = function () {
+        self.pipeline = true;
+        if (self.stream.cork) {
+            self.stream.cork();
+        }
+    };
+    this.uncork = function () {
+        if (self.fire_strings) {
+            self.write_strings();
+        } else {
+            self.write_buffers();
+        }
+        self.pipeline = false;
+        self.fire_strings = true;
+        if (self.stream.uncork) {
+            // TODO: Consider using next tick here. See https://github.com/NodeRedis/node_redis/issues/1033
+            self.stream.uncork();
+        }
+    };
+
+    // Restore modal commands from previous connection. The order of the commands is important
+    if (this.selected_db !== undefined) {
+        this.internal_send_command(new Command('select', [this.selected_db]));
+    }
+    if (this.monitoring) { // Monitor has to be fired before pub sub commands
+        this.internal_send_command(new Command('monitor', []));
+    }
+    var callback_count = Object.keys(this.subscription_set).length;
+    if (!this.options.disable_resubscribing && callback_count) {
+        // only emit 'ready' when all subscriptions were made again
+        // TODO: Remove the countdown for ready here. This is not coherent with all other modes and should therefore not be handled special
+        // We know we are ready as soon as all commands were fired
+        var callback = function () {
+            callback_count--;
+            if (callback_count === 0) {
+                self.emit('ready');
+            }
+        };
+        debug('Sending pub/sub on_ready commands');
+        for (var key in this.subscription_set) {
+            var command = key.slice(0, key.indexOf('_'));
+            var args = this.subscription_set[key];
+            this[command]([args], callback);
+        }
+        this.send_offline_queue();
+        return;
+    }
+    this.send_offline_queue();
+    this.emit('ready');
+};
+
+RedisClient.prototype.on_info_cmd = function (err, res) {
+    if (err) {
+        if (err.message === "ERR unknown command 'info'") {
+            this.on_ready();
+            return;
+        }
+        err.message = 'Ready check failed: ' + err.message;
+        this.emit('error', err);
+        return;
+    }
+
+    /* istanbul ignore if: some servers might not respond with any info data. This is just a safety check that is difficult to test */
+    if (!res) {
+        debug('The info command returned without any data.');
+        this.on_ready();
+        return;
+    }
+
+    if (!this.server_info.loading || this.server_info.loading === '0') {
+        // If the master_link_status exists but the link is not up, try again after 50 ms
+        if (this.server_info.master_link_status && this.server_info.master_link_status !== 'up') {
+            this.server_info.loading_eta_seconds = 0.05;
+        } else {
+            // Eta loading should change
+            debug('Redis server ready.');
+            this.on_ready();
+            return;
+        }
+    }
+
+    var retry_time = +this.server_info.loading_eta_seconds * 1000;
+    if (retry_time > 1000) {
+        retry_time = 1000;
+    }
+    debug('Redis server still loading, trying again in ' + retry_time);
+    setTimeout(function (self) {
+        self.ready_check();
+    }, retry_time, this);
+};
+
+RedisClient.prototype.ready_check = function () {
+    var self = this;
+    debug('Checking server ready state...');
+    // Always fire this info command as first command even if other commands are already queued up
+    this.ready = true;
+    this.info(function (err, res) {
+        self.on_info_cmd(err, res);
+    });
+    this.ready = false;
+};
+
+RedisClient.prototype.send_offline_queue = function () {
+    for (var command_obj = this.offline_queue.shift(); command_obj; command_obj = this.offline_queue.shift()) {
+        debug('Sending offline command: ' + command_obj.command);
+        this.internal_send_command(command_obj);
+    }
+    this.drain();
+};
+
+var retry_connection = function (self, error) {
+    debug('Retrying connection...');
+
+    var reconnect_params = {
+        delay: self.retry_delay,
+        attempt: self.attempts,
+        error: error
+    };
+    if (self.options.camel_case) {
+        reconnect_params.totalRetryTime = self.retry_totaltime;
+        reconnect_params.timesConnected = self.times_connected;
+    } else {
+        reconnect_params.total_retry_time = self.retry_totaltime;
+        reconnect_params.times_connected = self.times_connected;
+    }
+    self.emit('reconnecting', reconnect_params);
+
+    self.retry_totaltime += self.retry_delay;
+    self.attempts += 1;
+    self.retry_delay = Math.round(self.retry_delay * self.retry_backoff);
+    self.create_stream();
+    self.retry_timer = null;
+};
+
+RedisClient.prototype.connection_gone = function (why, error) {
+    // If a retry is already in progress, just let that happen
+    if (this.retry_timer) {
+        return;
+    }
+    error = error || null;
+
+    debug('Redis connection is gone from ' + why + ' event.');
+    this.connected = false;
+    this.ready = false;
+    // Deactivate cork to work with the offline queue
+    this.cork = noop;
+    this.uncork = noop;
+    this.pipeline = false;
+    this.pub_sub_mode = 0;
+
+    // since we are collapsing end and close, users don't expect to be called twice
+    if (!this.emitted_end) {
+        this.emit('end');
+        this.emitted_end = true;
+    }
+
+    // If this is a requested shutdown, then don't retry
+    if (this.closing) {
+        debug('Connection ended by quit / end command, not retrying.');
+        this.flush_and_error({
+            message: 'Stream connection ended and command aborted.',
+            code: 'NR_CLOSED'
+        }, {
+            error: error
+        });
+        return;
+    }
+
+    if (typeof this.options.retry_strategy === 'function') {
+        var retry_params = {
+            attempt: this.attempts,
+            error: error
+        };
+        if (this.options.camel_case) {
+            retry_params.totalRetryTime = this.retry_totaltime;
+            retry_params.timesConnected = this.times_connected;
+        } else {
+            retry_params.total_retry_time = this.retry_totaltime;
+            retry_params.times_connected = this.times_connected;
+        }
+        this.retry_delay = this.options.retry_strategy(retry_params);
+        if (typeof this.retry_delay !== 'number') {
+            // Pass individual error through
+            if (this.retry_delay instanceof Error) {
+                error = this.retry_delay;
+            }
+            this.flush_and_error({
+                message: 'Stream connection ended and command aborted.',
+                code: 'NR_CLOSED'
+            }, {
+                error: error
+            });
+            this.end(false);
+            return;
+        }
+    }
+
+    if (this.max_attempts !== 0 && this.attempts >= this.max_attempts || this.retry_totaltime >= this.connect_timeout) {
+        var message = 'Redis connection in broken state: ';
+        if (this.retry_totaltime >= this.connect_timeout) {
+            message += 'connection timeout exceeded.';
+        } else {
+            message += 'maximum connection attempts exceeded.';
+        }
+
+        this.flush_and_error({
+            message: message,
+            code: 'CONNECTION_BROKEN',
+        }, {
+            error: error
+        });
+        var err = new Error(message);
+        err.code = 'CONNECTION_BROKEN';
+        if (error) {
+            err.origin = error;
+        }
+        this.emit('error', err);
+        this.end(false);
+        return;
+    }
+
+    // Retry commands after a reconnect instead of throwing an error. Use this with caution
+    if (this.options.retry_unfulfilled_commands) {
+        this.offline_queue.unshift.apply(this.offline_queue, this.command_queue.toArray());
+        this.command_queue.clear();
+    } else if (this.command_queue.length !== 0) {
+        this.flush_and_error({
+            message: 'Redis connection lost and command aborted.',
+            code: 'UNCERTAIN_STATE'
+        }, {
+            error: error,
+            queues: ['command_queue']
+        });
+    }
+
+    if (this.retry_max_delay !== null && this.retry_delay > this.retry_max_delay) {
+        this.retry_delay = this.retry_max_delay;
+    } else if (this.retry_totaltime + this.retry_delay > this.connect_timeout) {
+        // Do not exceed the maximum
+        this.retry_delay = this.connect_timeout - this.retry_totaltime;
+    }
+
+    debug('Retry connection in ' + this.retry_delay + ' ms');
+
+    this.retry_timer = setTimeout(retry_connection, this.retry_delay, this, error);
+};
+
+RedisClient.prototype.return_error = function (err) {
+    var command_obj = this.command_queue.shift();
+    if (command_obj.error) {
+        err.stack = command_obj.error.stack.replace(/^Error.*?\n/, 'ReplyError: ' + err.message + '\n');
+    }
+    err.command = command_obj.command.toUpperCase();
+    if (command_obj.args && command_obj.args.length) {
+        err.args = command_obj.args;
+    }
+
+    // Count down pub sub mode if in entering modus
+    if (this.pub_sub_mode > 1) {
+        this.pub_sub_mode--;
+    }
+
+    var match = err.message.match(utils.err_code);
+    // LUA script could return user errors that don't behave like all other errors!
+    if (match) {
+        err.code = match[1];
+    }
+
+    utils.callback_or_emit(this, command_obj.callback, err);
+};
+
+RedisClient.prototype.drain = function () {
+    this.emit('drain');
+    this.should_buffer = false;
+};
+
+RedisClient.prototype.emit_idle = function () {
+    if (this.command_queue.length === 0 && this.pub_sub_mode === 0) {
+        this.emit('idle');
+    }
+};
+
+function normal_reply (self, reply) {
+    var command_obj = self.command_queue.shift();
+    if (typeof command_obj.callback === 'function') {
+        if (command_obj.command !== 'exec') {
+            reply = self.handle_reply(reply, command_obj.command, command_obj.buffer_args);
+        }
+        command_obj.callback(null, reply);
+    } else {
+        debug('No callback for reply');
+    }
+}
+
+function subscribe_unsubscribe (self, reply, type) {
+    // Subscribe commands take an optional callback and also emit an event, but only the _last_ response is included in the callback
+    // The pub sub commands return each argument in a separate return value and have to be handled that way
+    var command_obj = self.command_queue.get(0);
+    var buffer = self.options.return_buffers || self.options.detect_buffers && command_obj.buffer_args;
+    var channel = (buffer || reply[1] === null) ? reply[1] : reply[1].toString();
+    var count = +reply[2]; // Return the channel counter as number no matter if `string_numbers` is activated or not
+    debug(type, channel);
+
+    // Emit first, then return the callback
+    if (channel !== null) { // Do not emit or "unsubscribe" something if there was no channel to unsubscribe from
+        self.emit(type, channel, count);
+        if (type === 'subscribe' || type === 'psubscribe') {
+            self.subscription_set[type + '_' + channel] = channel;
+        } else {
+            type = type === 'unsubscribe' ? 'subscribe' : 'psubscribe'; // Make types consistent
+            delete self.subscription_set[type + '_' + channel];
+        }
+    }
+
+    if (command_obj.args.length === 1 || self.sub_commands_left === 1 || command_obj.args.length === 0 && (count === 0 || channel === null)) {
+        if (count === 0) { // unsubscribed from all channels
+            var running_command;
+            var i = 1;
+            self.pub_sub_mode = 0; // Deactivating pub sub mode
+            // This should be a rare case and therefore handling it this way should be good performance wise for the general case
+            while (running_command = self.command_queue.get(i)) {
+                if (SUBSCRIBE_COMMANDS[running_command.command]) {
+                    self.pub_sub_mode = i; // Entering pub sub mode again
+                    break;
+                }
+                i++;
+            }
+        }
+        self.command_queue.shift();
+        if (typeof command_obj.callback === 'function') {
+            // TODO: The current return value is pretty useless.
+            // Evaluate to change this in v.3 to return all subscribed / unsubscribed channels in an array including the number of channels subscribed too
+            command_obj.callback(null, channel);
+        }
+        self.sub_commands_left = 0;
+    } else {
+        if (self.sub_commands_left !== 0) {
+            self.sub_commands_left--;
+        } else {
+            self.sub_commands_left = command_obj.args.length ? command_obj.args.length - 1 : count;
+        }
+    }
+}
+
+function return_pub_sub (self, reply) {
+    var type = reply[0].toString();
+    if (type === 'message') { // channel, message
+        if (!self.options.return_buffers || self.message_buffers) { // backwards compatible. Refactor this in v.3 to always return a string on the normal emitter
+            self.emit('message', reply[1].toString(), reply[2].toString());
+            self.emit('message_buffer', reply[1], reply[2]);
+            self.emit('messageBuffer', reply[1], reply[2]);
+        } else {
+            self.emit('message', reply[1], reply[2]);
+        }
+    } else if (type === 'pmessage') { // pattern, channel, message
+        if (!self.options.return_buffers || self.message_buffers) { // backwards compatible. Refactor this in v.3 to always return a string on the normal emitter
+            self.emit('pmessage', reply[1].toString(), reply[2].toString(), reply[3].toString());
+            self.emit('pmessage_buffer', reply[1], reply[2], reply[3]);
+            self.emit('pmessageBuffer', reply[1], reply[2], reply[3]);
+        } else {
+            self.emit('pmessage', reply[1], reply[2], reply[3]);
+        }
+    } else {
+        subscribe_unsubscribe(self, reply, type);
+    }
+}
+
+RedisClient.prototype.return_reply = function (reply) {
+    if (this.monitoring) {
+        var replyStr;
+        if (this.buffers && Buffer.isBuffer(reply)) {
+            replyStr = reply.toString();
+        } else {
+            replyStr = reply;
+        }
+        // If in monitor mode, all normal commands are still working and we only want to emit the streamlined commands
+        if (typeof replyStr === 'string' && utils.monitor_regex.test(replyStr)) {
+            var timestamp = replyStr.slice(0, replyStr.indexOf(' '));
+            var args = replyStr.slice(replyStr.indexOf('"') + 1, -1).split('" "').map(function (elem) {
+                return elem.replace(/\\"/g, '"');
+            });
+            this.emit('monitor', timestamp, args, replyStr);
+            return;
+        }
+    }
+    if (this.pub_sub_mode === 0) {
+        normal_reply(this, reply);
+    } else if (this.pub_sub_mode !== 1) {
+        this.pub_sub_mode--;
+        normal_reply(this, reply);
+    } else if (!(reply instanceof Array) || reply.length <= 2) {
+        // Only PING and QUIT are allowed in this context besides the pub sub commands
+        // Ping replies with ['pong', null|value] and quit with 'OK'
+        normal_reply(this, reply);
+    } else {
+        return_pub_sub(this, reply);
+    }
+};
+
+function handle_offline_command (self, command_obj) {
+    var command = command_obj.command;
+    var err, msg;
+    if (self.closing || !self.enable_offline_queue) {
+        command = command.toUpperCase();
+        if (!self.closing) {
+            if (self.stream.writable) {
+                msg = 'The connection is not yet established and the offline queue is deactivated.';
+            } else {
+                msg = 'Stream not writeable.';
+            }
+        } else {
+            msg = 'The connection is already closed.';
+        }
+        err = new errorClasses.AbortError({
+            message: command + " can't be processed. " + msg,
+            code: 'NR_CLOSED',
+            command: command
+        });
+        if (command_obj.args.length) {
+            err.args = command_obj.args;
+        }
+        utils.reply_in_order(self, command_obj.callback, err);
+    } else {
+        debug('Queueing ' + command + ' for next server connection.');
+        self.offline_queue.push(command_obj);
+    }
+    self.should_buffer = true;
+}
+
+// Do not call internal_send_command directly, if you are not absolutly certain it handles everything properly
+// e.g. monitor / info does not work with internal_send_command only
+RedisClient.prototype.internal_send_command = function (command_obj) {
+    var arg, prefix_keys;
+    var i = 0;
+    var command_str = '';
+    var args = command_obj.args;
+    var command = command_obj.command;
+    var len = args.length;
+    var big_data = false;
+    var args_copy = new Array(len);
+
+    if (process.domain && command_obj.callback) {
+        command_obj.callback = process.domain.bind(command_obj.callback);
+    }
+
+    if (this.ready === false || this.stream.writable === false) {
+        // Handle offline commands right away
+        handle_offline_command(this, command_obj);
+        return false; // Indicate buffering
+    }
+
+    for (i = 0; i < len; i += 1) {
+        if (typeof args[i] === 'string') {
+            // 30000 seemed to be a good value to switch to buffers after testing and checking the pros and cons
+            if (args[i].length > 30000) {
+                big_data = true;
+                args_copy[i] = new Buffer(args[i], 'utf8');
+            } else {
+                args_copy[i] = args[i];
+            }
+        } else if (typeof args[i] === 'object') { // Checking for object instead of Buffer.isBuffer helps us finding data types that we can't handle properly
+            if (args[i] instanceof Date) { // Accept dates as valid input
+                args_copy[i] = args[i].toString();
+            } else if (args[i] === null) {
+                this.warn(
+                    'Deprecated: The ' + command.toUpperCase() + ' command contains a "null" argument.\n' +
+                    'This is converted to a "null" string now and will return an error from v.3.0 on.\n' +
+                    'Please handle this in your code to make sure everything works as you intended it to.'
+                );
+                args_copy[i] = 'null'; // Backwards compatible :/
+            } else if (Buffer.isBuffer(args[i])) {
+                args_copy[i] = args[i];
+                command_obj.buffer_args = true;
+                big_data = true;
+            } else {
+                this.warn(
+                    'Deprecated: The ' + command.toUpperCase() + ' command contains a argument of type ' + args[i].constructor.name + '.\n' +
+                    'This is converted to "' + args[i].toString() + '" by using .toString() now and will return an error from v.3.0 on.\n' +
+                    'Please handle this in your code to make sure everything works as you intended it to.'
+                );
+                args_copy[i] = args[i].toString(); // Backwards compatible :/
+            }
+        } else if (typeof args[i] === 'undefined') {
+            this.warn(
+                'Deprecated: The ' + command.toUpperCase() + ' command contains a "undefined" argument.\n' +
+                'This is converted to a "undefined" string now and will return an error from v.3.0 on.\n' +
+                'Please handle this in your code to make sure everything works as you intended it to.'
+            );
+            args_copy[i] = 'undefined'; // Backwards compatible :/
+        } else {
+            // Seems like numbers are converted fast using string concatenation
+            args_copy[i] = '' + args[i];
+        }
+    }
+
+    if (this.options.prefix) {
+        prefix_keys = commands.getKeyIndexes(command, args_copy);
+        for (i = prefix_keys.pop(); i !== undefined; i = prefix_keys.pop()) {
+            args_copy[i] = this.options.prefix + args_copy[i];
+        }
+    }
+    if (this.options.rename_commands && this.options.rename_commands[command]) {
+        command = this.options.rename_commands[command];
+    }
+    // Always use 'Multi bulk commands', but if passed any Buffer args, then do multiple writes, one for each arg.
+    // This means that using Buffers in commands is going to be slower, so use Strings if you don't already have a Buffer.
+    command_str = '*' + (len + 1) + '\r\n$' + command.length + '\r\n' + command + '\r\n';
+
+    if (big_data === false) { // Build up a string and send entire command in one write
+        for (i = 0; i < len; i += 1) {
+            arg = args_copy[i];
+            command_str += '$' + Buffer.byteLength(arg) + '\r\n' + arg + '\r\n';
+        }
+        debug('Send ' + this.address + ' id ' + this.connection_id + ': ' + command_str);
+        this.write(command_str);
+    } else {
+        debug('Send command (' + command_str + ') has Buffer arguments');
+        this.fire_strings = false;
+        this.write(command_str);
+
+        for (i = 0; i < len; i += 1) {
+            arg = args_copy[i];
+            if (typeof arg === 'string') {
+                this.write('$' + Buffer.byteLength(arg) + '\r\n' + arg + '\r\n');
+            } else { // buffer
+                this.write('$' + arg.length + '\r\n');
+                this.write(arg);
+                this.write('\r\n');
+            }
+            debug('send_command: buffer send ' + arg.length + ' bytes');
+        }
+    }
+    if (command_obj.call_on_write) {
+        command_obj.call_on_write();
+    }
+    // Handle `CLIENT REPLY ON|OFF|SKIP`
+    // This has to be checked after call_on_write
+    /* istanbul ignore else: TODO: Remove this as soon as we test Redis 3.2 on travis */
+    if (this.reply === 'ON') {
+        this.command_queue.push(command_obj);
+    } else {
+        // Do not expect a reply
+        // Does this work in combination with the pub sub mode?
+        if (command_obj.callback) {
+            utils.reply_in_order(this, command_obj.callback, null, undefined, this.command_queue);
+        }
+        if (this.reply === 'SKIP') {
+            this.reply = 'SKIP_ONE_MORE';
+        } else if (this.reply === 'SKIP_ONE_MORE') {
+            this.reply = 'ON';
+        }
+    }
+    return !this.should_buffer;
+};
+
+RedisClient.prototype.write_strings = function () {
+    var str = '';
+    for (var command = this.pipeline_queue.shift(); command; command = this.pipeline_queue.shift()) {
+        // Write to stream if the string is bigger than 4mb. The biggest string may be Math.pow(2, 28) - 15 chars long
+        if (str.length + command.length > 4 * 1024 * 1024) {
+            this.should_buffer = !this.stream.write(str);
+            str = '';
+        }
+        str += command;
+    }
+    if (str !== '') {
+        this.should_buffer = !this.stream.write(str);
+    }
+};
+
+RedisClient.prototype.write_buffers = function () {
+    for (var command = this.pipeline_queue.shift(); command; command = this.pipeline_queue.shift()) {
+        this.should_buffer = !this.stream.write(command);
+    }
+};
+
+RedisClient.prototype.write = function (data) {
+    if (this.pipeline === false) {
+        this.should_buffer = !this.stream.write(data);
+        return;
+    }
+    this.pipeline_queue.push(data);
+};
+
+Object.defineProperty(exports, 'debugMode', {
+    get: function () {
+        return this.debug_mode;
+    },
+    set: function (val) {
+        this.debug_mode = val;
+    }
+});
+
+// Don't officially expose the command_queue directly but only the length as read only variable
+Object.defineProperty(RedisClient.prototype, 'command_queue_length', {
+    get: function () {
+        return this.command_queue.length;
+    }
+});
+
+Object.defineProperty(RedisClient.prototype, 'offline_queue_length', {
+    get: function () {
+        return this.offline_queue.length;
+    }
+});
+
+// Add support for camelCase by adding read only properties to the client
+// All known exposed snake_case variables are added here
+Object.defineProperty(RedisClient.prototype, 'retryDelay', {
+    get: function () {
+        return this.retry_delay;
+    }
+});
+
+Object.defineProperty(RedisClient.prototype, 'retryBackoff', {
+    get: function () {
+        return this.retry_backoff;
+    }
+});
+
+Object.defineProperty(RedisClient.prototype, 'commandQueueLength', {
+    get: function () {
+        return this.command_queue.length;
+    }
+});
+
+Object.defineProperty(RedisClient.prototype, 'offlineQueueLength', {
+    get: function () {
+        return this.offline_queue.length;
+    }
+});
+
+Object.defineProperty(RedisClient.prototype, 'shouldBuffer', {
+    get: function () {
+        return this.should_buffer;
+    }
+});
+
+Object.defineProperty(RedisClient.prototype, 'connectionId', {
+    get: function () {
+        return this.connection_id;
+    }
+});
+
+Object.defineProperty(RedisClient.prototype, 'serverInfo', {
+    get: function () {
+        return this.server_info;
+    }
+});
+
+exports.createClient = function () {
+    return new RedisClient(unifyOptions.apply(null, arguments));
+};
+exports.RedisClient = RedisClient;
+exports.print = utils.print;
+exports.Multi = require('./lib/multi');
+exports.AbortError = errorClasses.AbortError;
+exports.RedisError = Parser.RedisError;
+exports.ParserError = Parser.ParserError;
+exports.ReplyError = Parser.ReplyError;
+exports.AggregateError = errorClasses.AggregateError;
+
+// Add all redis commands / node_redis api to the client
+require('./lib/individualCommands');
+require('./lib/extendedApi');
+
+//enables adding new commands (for modules and new commands)
+exports.addCommand = exports.add_command = require('./lib/commands');
\ No newline at end of file
diff --git a/node_modules/redis/lib/command.js b/node_modules/redis/lib/command.js
new file mode 100644
index 0000000..717115c
--- /dev/null
+++ b/node_modules/redis/lib/command.js
@@ -0,0 +1,16 @@
+'use strict';
+
+var betterStackTraces = /development/i.test(process.env.NODE_ENV) || /\bredis\b/i.test(process.env.NODE_DEBUG);
+
+function Command (command, args, callback, call_on_write) {
+    this.command = command;
+    this.args = args;
+    this.buffer_args = false;
+    this.callback = callback;
+    this.call_on_write = call_on_write;
+    if (betterStackTraces) {
+        this.error = new Error();
+    }
+}
+
+module.exports = Command;
diff --git a/node_modules/redis/lib/commands.js b/node_modules/redis/lib/commands.js
new file mode 100644
index 0000000..6275ec8
--- /dev/null
+++ b/node_modules/redis/lib/commands.js
@@ -0,0 +1,121 @@
+'use strict';
+
+var commands = require('redis-commands');
+var Multi = require('./multi');
+var RedisClient = require('../').RedisClient;
+var Command = require('./command');
+// Feature detect if a function may change it's name
+var changeFunctionName = (function () {
+    var fn = function abc () {};
+    try {
+        Object.defineProperty(fn, 'name', {
+            value: 'foobar'
+        });
+        return true;
+    } catch (e) {
+        return false;
+    }
+}());
+
+var addCommand = function (command) {
+    // Some rare Redis commands use special characters in their command name
+    // Convert those to a underscore to prevent using invalid function names
+    var commandName = command.replace(/(?:^([0-9])|[^a-zA-Z0-9_$])/g, '_$1');
+
+    // Do not override existing functions
+    if (!RedisClient.prototype[command]) {
+        RedisClient.prototype[command.toUpperCase()] = RedisClient.prototype[command] = function () {
+            var arr;
+            var len = arguments.length;
+            var callback;
+            var i = 0;
+            if (Array.isArray(arguments[0])) {
+                arr = arguments[0];
+                if (len === 2) {
+                    callback = arguments[1];
+                }
+            } else if (len > 1 && Array.isArray(arguments[1])) {
+                if (len === 3) {
+                    callback = arguments[2];
+                }
+                len = arguments[1].length;
+                arr = new Array(len + 1);
+                arr[0] = arguments[0];
+                for (; i < len; i += 1) {
+                    arr[i + 1] = arguments[1][i];
+                }
+            } else {
+                // The later should not be the average use case
+                if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+                    len--;
+                    callback = arguments[len];
+                }
+                arr = new Array(len);
+                for (; i < len; i += 1) {
+                    arr[i] = arguments[i];
+                }
+            }
+            return this.internal_send_command(new Command(command, arr, callback));
+        };
+        // Alias special function names (e.g. NR.RUN becomes NR_RUN and nr_run)
+        if (commandName !== command) {
+            RedisClient.prototype[commandName.toUpperCase()] = RedisClient.prototype[commandName] = RedisClient.prototype[command];
+        }
+        if (changeFunctionName) {
+            Object.defineProperty(RedisClient.prototype[command], 'name', {
+                value: commandName
+            });
+        }
+    }
+
+    // Do not override existing functions
+    if (!Multi.prototype[command]) {
+        Multi.prototype[command.toUpperCase()] = Multi.prototype[command] = function () {
+            var arr;
+            var len = arguments.length;
+            var callback;
+            var i = 0;
+            if (Array.isArray(arguments[0])) {
+                arr = arguments[0];
+                if (len === 2) {
+                    callback = arguments[1];
+                }
+            } else if (len > 1 && Array.isArray(arguments[1])) {
+                if (len === 3) {
+                    callback = arguments[2];
+                }
+                len = arguments[1].length;
+                arr = new Array(len + 1);
+                arr[0] = arguments[0];
+                for (; i < len; i += 1) {
+                    arr[i + 1] = arguments[1][i];
+                }
+            } else {
+                // The later should not be the average use case
+                if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+                    len--;
+                    callback = arguments[len];
+                }
+                arr = new Array(len);
+                for (; i < len; i += 1) {
+                    arr[i] = arguments[i];
+                }
+            }
+            this.queue.push(new Command(command, arr, callback));
+            return this;
+        };
+        // Alias special function names (e.g. NR.RUN becomes NR_RUN and nr_run)
+        if (commandName !== command) {
+            Multi.prototype[commandName.toUpperCase()] = Multi.prototype[commandName] = Multi.prototype[command];
+        }
+        if (changeFunctionName) {
+            Object.defineProperty(Multi.prototype[command], 'name', {
+                value: commandName
+            });
+        }
+    }
+};
+
+commands.list.forEach(addCommand);
+
+module.exports = addCommand;
diff --git a/node_modules/redis/lib/createClient.js b/node_modules/redis/lib/createClient.js
new file mode 100644
index 0000000..2f3b09f
--- /dev/null
+++ b/node_modules/redis/lib/createClient.js
@@ -0,0 +1,80 @@
+'use strict';
+
+var utils = require('./utils');
+var URL = require('url');
+
+module.exports = function createClient (port_arg, host_arg, options) {
+
+    if (typeof port_arg === 'number' || typeof port_arg === 'string' && /^\d+$/.test(port_arg)) {
+
+        var host;
+        if (typeof host_arg === 'string') {
+            host = host_arg;
+        } else {
+            if (options && host_arg) {
+                throw new TypeError('Unknown type of connection in createClient()');
+            }
+            options = options || host_arg;
+        }
+        options = utils.clone(options);
+        options.host = host || options.host;
+        options.port = port_arg;
+
+    } else if (typeof port_arg === 'string' || port_arg && port_arg.url) {
+
+        options = utils.clone(port_arg.url ? port_arg : host_arg || options);
+        var url = port_arg.url || port_arg;
+        var parsed = URL.parse(url, true, true);
+
+        // [redis:]//[[user][:password]@][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]
+        if (parsed.slashes) { // We require slashes
+            if (parsed.auth) {
+                options.password = parsed.auth.split(':')[1];
+            }
+            if (parsed.protocol && parsed.protocol !== 'redis:') {
+                console.warn('node_redis: WARNING: You passed "' + parsed.protocol.substring(0, parsed.protocol.length - 1) + '" as protocol instead of the "redis" protocol!');
+            }
+            if (parsed.pathname && parsed.pathname !== '/') {
+                options.db = parsed.pathname.substr(1);
+            }
+            if (parsed.hostname) {
+                options.host = parsed.hostname;
+            }
+            if (parsed.port) {
+                options.port = parsed.port;
+            }
+            if (parsed.search !== '') {
+                var elem;
+                for (elem in parsed.query) {
+                    // If options are passed twice, only the parsed options will be used
+                    if (elem in options) {
+                        if (options[elem] === parsed.query[elem]) {
+                            console.warn('node_redis: WARNING: You passed the ' + elem + ' option twice!');
+                        } else {
+                            throw new RangeError('The ' + elem + ' option is added twice and does not match');
+                        }
+                    }
+                    options[elem] = parsed.query[elem];
+                }
+            }
+        } else if (parsed.hostname) {
+            throw new RangeError('The redis url must begin with slashes "//" or contain slashes after the redis protocol');
+        } else {
+            options.path = url;
+        }
+
+    } else if (typeof port_arg === 'object' || port_arg === undefined) {
+        options = utils.clone(port_arg || options);
+        options.host = options.host || host_arg;
+
+        if (port_arg && arguments.length !== 1) {
+            throw new TypeError('To many arguments passed to createClient. Please only pass the options object');
+        }
+    }
+
+    if (!options) {
+        throw new TypeError('Unknown type of connection in createClient()');
+    }
+
+    return options;
+};
diff --git a/node_modules/redis/lib/customErrors.js b/node_modules/redis/lib/customErrors.js
new file mode 100644
index 0000000..d9b3442
--- /dev/null
+++ b/node_modules/redis/lib/customErrors.js
@@ -0,0 +1,59 @@
+'use strict';
+
+var util = require('util');
+var assert = require('assert');
+var RedisError = require('redis-parser').RedisError;
+var ADD_STACKTRACE = false;
+
+function AbortError (obj, stack) {
+    assert(obj, 'The options argument is required');
+    assert.strictEqual(typeof obj, 'object', 'The options argument has to be of type object');
+
+    RedisError.call(this, obj.message, ADD_STACKTRACE);
+    Object.defineProperty(this, 'message', {
+        value: obj.message || '',
+        configurable: true,
+        writable: true
+    });
+    if (stack || stack === undefined) {
+        Error.captureStackTrace(this, AbortError);
+    }
+    for (var keys = Object.keys(obj), key = keys.pop(); key; key = keys.pop()) {
+        this[key] = obj[key];
+    }
+}
+
+function AggregateError (obj) {
+    assert(obj, 'The options argument is required');
+    assert.strictEqual(typeof obj, 'object', 'The options argument has to be of type object');
+
+    AbortError.call(this, obj, ADD_STACKTRACE);
+    Object.defineProperty(this, 'message', {
+        value: obj.message || '',
+        configurable: true,
+        writable: true
+    });
+    Error.captureStackTrace(this, AggregateError);
+    for (var keys = Object.keys(obj), key = keys.pop(); key; key = keys.pop()) {
+        this[key] = obj[key];
+    }
+}
+
+util.inherits(AbortError, RedisError);
+util.inherits(AggregateError, AbortError);
+
+Object.defineProperty(AbortError.prototype, 'name', {
+    value: 'AbortError',
+    configurable: true,
+    writable: true
+});
+Object.defineProperty(AggregateError.prototype, 'name', {
+    value: 'AggregateError',
+    configurable: true,
+    writable: true
+});
+
+module.exports = {
+    AbortError: AbortError,
+    AggregateError: AggregateError
+};
diff --git a/node_modules/redis/lib/debug.js b/node_modules/redis/lib/debug.js
new file mode 100644
index 0000000..0e6333f
--- /dev/null
+++ b/node_modules/redis/lib/debug.js
@@ -0,0 +1,11 @@
+'use strict';
+
+var index = require('../');
+
+function debug () {
+    if (index.debug_mode) {
+        console.error.apply(null, arguments);
+    }
+}
+
+module.exports = debug;
diff --git a/node_modules/redis/lib/extendedApi.js b/node_modules/redis/lib/extendedApi.js
new file mode 100644
index 0000000..bac3691
--- /dev/null
+++ b/node_modules/redis/lib/extendedApi.js
@@ -0,0 +1,113 @@
+'use strict';
+
+var utils = require('./utils');
+var debug = require('./debug');
+var RedisClient = require('../').RedisClient;
+var Command = require('./command');
+var noop = function () {};
+
+/**********************************************
+All documented and exposed API belongs in here
+**********************************************/
+
+// Redirect calls to the appropriate function and use to send arbitrary / not supported commands
+RedisClient.prototype.send_command = RedisClient.prototype.sendCommand = function (command, args, callback) {
+    // Throw to fail early instead of relying in order in this case
+    if (typeof command !== 'string') {
+        throw new TypeError('Wrong input type "' + (command !== null && command !== undefined ? command.constructor.name : command) + '" for command name');
+    }
+    command = command.toLowerCase();
+    if (!Array.isArray(args)) {
+        if (args === undefined || args === null) {
+            args = [];
+        } else if (typeof args === 'function' && callback === undefined) {
+            callback = args;
+            args = [];
+        } else {
+            throw new TypeError('Wrong input type "' + args.constructor.name + '" for args');
+        }
+    }
+    if (typeof callback !== 'function' && callback !== undefined) {
+        throw new TypeError('Wrong input type "' + (callback !== null ? callback.constructor.name : 'null') + '" for callback function');
+    }
+
+    // Using the raw multi command is only possible with this function
+    // If the command is not yet added to the client, the internal function should be called right away
+    // Otherwise we need to redirect the calls to make sure the internal functions don't get skipped
+    // The internal functions could actually be used for any non hooked function
+    // but this might change from time to time and at the moment there's no good way to distinguish them
+    // from each other, so let's just do it do it this way for the time being
+    if (command === 'multi' || typeof this[command] !== 'function') {
+        return this.internal_send_command(new Command(command, args, callback));
+    }
+    if (typeof callback === 'function') {
+        args = args.concat([callback]); // Prevent manipulating the input array
+    }
+    return this[command].apply(this, args);
+};
+
+RedisClient.prototype.end = function (flush) {
+    // Flush queue if wanted
+    if (flush) {
+        this.flush_and_error({
+            message: 'Connection forcefully ended and command aborted.',
+            code: 'NR_CLOSED'
+        });
+    } else if (arguments.length === 0) {
+        this.warn(
+            'Using .end() without the flush parameter is deprecated and throws from v.3.0.0 on.\n' +
+            'Please check the doku (https://github.com/NodeRedis/node_redis) and explictly use flush.'
+        );
+    }
+    // Clear retry_timer
+    if (this.retry_timer) {
+        clearTimeout(this.retry_timer);
+        this.retry_timer = null;
+    }
+    this.stream.removeAllListeners();
+    this.stream.on('error', noop);
+    this.connected = false;
+    this.ready = false;
+    this.closing = true;
+    return this.stream.destroySoon();
+};
+
+RedisClient.prototype.unref = function () {
+    if (this.connected) {
+        debug("Unref'ing the socket connection");
+        this.stream.unref();
+    } else {
+        debug('Not connected yet, will unref later');
+        this.once('connect', function () {
+            this.unref();
+        });
+    }
+};
+
+RedisClient.prototype.duplicate = function (options, callback) {
+    if (typeof options === 'function') {
+        callback = options;
+        options = null;
+    }
+    var existing_options = utils.clone(this.options);
+    options = utils.clone(options);
+    for (var elem in options) {
+        existing_options[elem] = options[elem];
+    }
+    var client = new RedisClient(existing_options);
+    client.selected_db = this.selected_db;
+    if (typeof callback === 'function') {
+        var ready_listener = function () {
+            callback(null, client);
+            client.removeAllListeners(error_listener);
+        };
+        var error_listener = function (err) {
+            callback(err);
+            client.end(true);
+        };
+        client.once('ready', ready_listener);
+        client.once('error', error_listener);
+        return;
+    }
+    return client;
+};
diff --git a/node_modules/redis/lib/individualCommands.js b/node_modules/redis/lib/individualCommands.js
new file mode 100644
index 0000000..d366b64
--- /dev/null
+++ b/node_modules/redis/lib/individualCommands.js
@@ -0,0 +1,617 @@
+'use strict';
+
+var utils = require('./utils');
+var debug = require('./debug');
+var Multi = require('./multi');
+var Command = require('./command');
+var no_password_is_set = /no password is set/;
+var loading = /LOADING/;
+var RedisClient = require('../').RedisClient;
+
+/********************************************************************************************
+ Replace built-in redis functions
+
+ The callback may be hooked as needed. The same does not apply to the rest of the function.
+ State should not be set outside of the callback if not absolutly necessary.
+ This is important to make sure it works the same as single command or in a multi context.
+ To make sure everything works with the offline queue use the "call_on_write" function.
+ This is going to be executed while writing to the stream.
+
+ TODO: Implement individal command generation as soon as possible to prevent divergent code
+ on single and multi calls!
+********************************************************************************************/
+
+RedisClient.prototype.multi = RedisClient.prototype.MULTI = function multi (args) {
+    var multi = new Multi(this, args);
+    multi.exec = multi.EXEC = multi.exec_transaction;
+    return multi;
+};
+
+// ATTENTION: This is not a native function but is still handled as a individual command as it behaves just the same as multi
+RedisClient.prototype.batch = RedisClient.prototype.BATCH = function batch (args) {
+    return new Multi(this, args);
+};
+
+function select_callback (self, db, callback) {
+    return function (err, res) {
+        if (err === null) {
+            // Store db in this.select_db to restore it on reconnect
+            self.selected_db = db;
+        }
+        utils.callback_or_emit(self, callback, err, res);
+    };
+}
+
+RedisClient.prototype.select = RedisClient.prototype.SELECT = function select (db, callback) {
+    return this.internal_send_command(new Command('select', [db], select_callback(this, db, callback)));
+};
+
+Multi.prototype.select = Multi.prototype.SELECT = function select (db, callback) {
+    this.queue.push(new Command('select', [db], select_callback(this._client, db, callback)));
+    return this;
+};
+
+RedisClient.prototype.monitor = RedisClient.prototype.MONITOR = function monitor (callback) {
+    // Use a individual command, as this is a special case that does not has to be checked for any other command
+    var self = this;
+    var call_on_write = function () {
+        // Activating monitor mode has to happen before Redis returned the callback. The monitor result is returned first.
+        // Therefore we expect the command to be properly processed. If this is not the case, it's not an issue either.
+        self.monitoring = true;
+    };
+    return this.internal_send_command(new Command('monitor', [], callback, call_on_write));
+};
+
+// Only works with batch, not in a transaction
+Multi.prototype.monitor = Multi.prototype.MONITOR = function monitor (callback) {
+    // Use a individual command, as this is a special case that does not has to be checked for any other command
+    if (this.exec !== this.exec_transaction) {
+        var self = this;
+        var call_on_write = function () {
+            self._client.monitoring = true;
+        };
+        this.queue.push(new Command('monitor', [], callback, call_on_write));
+        return this;
+    }
+    // Set multi monitoring to indicate the exec that it should abort
+    // Remove this "hack" as soon as Redis might fix this
+    this.monitoring = true;
+    return this;
+};
+
+function quit_callback (self, callback) {
+    return function (err, res) {
+        if (err && err.code === 'NR_CLOSED') {
+            // Pretent the quit command worked properly in this case.
+            // Either the quit landed in the offline queue and was flushed at the reconnect
+            // or the offline queue is deactivated and the command was rejected right away
+            // or the stream is not writable
+            // or while sending the quit, the connection ended / closed
+            err = null;
+            res = 'OK';
+        }
+        utils.callback_or_emit(self, callback, err, res);
+        if (self.stream.writable) {
+            // If the socket is still alive, kill it. This could happen if quit got a NR_CLOSED error code
+            self.stream.destroy();
+        }
+    };
+}
+
+RedisClient.prototype.QUIT = RedisClient.prototype.quit = function quit (callback) {
+    // TODO: Consider this for v.3
+    // Allow the quit command to be fired as soon as possible to prevent it landing in the offline queue.
+    // this.ready = this.offline_queue.length === 0;
+    var backpressure_indicator = this.internal_send_command(new Command('quit', [], quit_callback(this, callback)));
+    // Calling quit should always end the connection, no matter if there's a connection or not
+    this.closing = true;
+    this.ready = false;
+    return backpressure_indicator;
+};
+
+// Only works with batch, not in a transaction
+Multi.prototype.QUIT = Multi.prototype.quit = function quit (callback) {
+    var self = this._client;
+    var call_on_write = function () {
+        // If called in a multi context, we expect redis is available
+        self.closing = true;
+        self.ready = false;
+    };
+    this.queue.push(new Command('quit', [], quit_callback(self, callback), call_on_write));
+    return this;
+};
+
+function info_callback (self, callback) {
+    return function (err, res) {
+        if (res) {
+            var obj = {};
+            var lines = res.toString().split('\r\n');
+            var line, parts, sub_parts;
+
+            for (var i = 0; i < lines.length; i++) {
+                parts = lines[i].split(':');
+                if (parts[1]) {
+                    if (parts[0].indexOf('db') === 0) {
+                        sub_parts = parts[1].split(',');
+                        obj[parts[0]] = {};
+                        while (line = sub_parts.pop()) {
+                            line = line.split('=');
+                            obj[parts[0]][line[0]] = +line[1];
+                        }
+                    } else {
+                        obj[parts[0]] = parts[1];
+                    }
+                }
+            }
+            obj.versions = [];
+            if (obj.redis_version) {
+                obj.redis_version.split('.').forEach(function (num) {
+                    obj.versions.push(+num);
+                });
+            }
+            // Expose info key/vals to users
+            self.server_info = obj;
+        } else {
+            self.server_info = {};
+        }
+        utils.callback_or_emit(self, callback, err, res);
+    };
+}
+
+// Store info in this.server_info after each call
+RedisClient.prototype.info = RedisClient.prototype.INFO = function info (section, callback) {
+    var args = [];
+    if (typeof section === 'function') {
+        callback = section;
+    } else if (section !== undefined) {
+        args = Array.isArray(section) ? section : [section];
+    }
+    return this.internal_send_command(new Command('info', args, info_callback(this, callback)));
+};
+
+Multi.prototype.info = Multi.prototype.INFO = function info (section, callback) {
+    var args = [];
+    if (typeof section === 'function') {
+        callback = section;
+    } else if (section !== undefined) {
+        args = Array.isArray(section) ? section : [section];
+    }
+    this.queue.push(new Command('info', args, info_callback(this._client, callback)));
+    return this;
+};
+
+function auth_callback (self, pass, callback) {
+    return function (err, res) {
+        if (err) {
+            if (no_password_is_set.test(err.message)) {
+                self.warn('Warning: Redis server does not require a password, but a password was supplied.');
+                err = null;
+                res = 'OK';
+            } else if (loading.test(err.message)) {
+                // If redis is still loading the db, it will not authenticate and everything else will fail
+                debug('Redis still loading, trying to authenticate later');
+                setTimeout(function () {
+                    self.auth(pass, callback);
+                }, 100);
+                return;
+            }
+        }
+        utils.callback_or_emit(self, callback, err, res);
+    };
+}
+
+RedisClient.prototype.auth = RedisClient.prototype.AUTH = function auth (pass, callback) {
+    debug('Sending auth to ' + this.address + ' id ' + this.connection_id);
+
+    // Stash auth for connect and reconnect.
+    this.auth_pass = pass;
+    var ready = this.ready;
+    this.ready = ready || this.offline_queue.length === 0;
+    var tmp = this.internal_send_command(new Command('auth', [pass], auth_callback(this, pass, callback)));
+    this.ready = ready;
+    return tmp;
+};
+
+// Only works with batch, not in a transaction
+Multi.prototype.auth = Multi.prototype.AUTH = function auth (pass, callback) {
+    debug('Sending auth to ' + this.address + ' id ' + this.connection_id);
+
+    // Stash auth for connect and reconnect.
+    this.auth_pass = pass;
+    this.queue.push(new Command('auth', [pass], auth_callback(this._client, callback)));
+    return this;
+};
+
+RedisClient.prototype.client = RedisClient.prototype.CLIENT = function client () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0];
+        callback = arguments[1];
+    } else if (Array.isArray(arguments[1])) {
+        if (len === 3) {
+            callback = arguments[2];
+        }
+        len = arguments[1].length;
+        arr = new Array(len + 1);
+        arr[0] = arguments[0];
+        for (; i < len; i += 1) {
+            arr[i + 1] = arguments[1][i];
+        }
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this;
+    var call_on_write = undefined;
+    // CLIENT REPLY ON|OFF|SKIP
+    /* istanbul ignore next: TODO: Remove this as soon as Travis runs Redis 3.2 */
+    if (arr.length === 2 && arr[0].toString().toUpperCase() === 'REPLY') {
+        var reply_on_off = arr[1].toString().toUpperCase();
+        if (reply_on_off === 'ON' || reply_on_off === 'OFF' || reply_on_off === 'SKIP') {
+            call_on_write = function () {
+                self.reply = reply_on_off;
+            };
+        }
+    }
+    return this.internal_send_command(new Command('client', arr, callback, call_on_write));
+};
+
+Multi.prototype.client = Multi.prototype.CLIENT = function client () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0];
+        callback = arguments[1];
+    } else if (Array.isArray(arguments[1])) {
+        if (len === 3) {
+            callback = arguments[2];
+        }
+        len = arguments[1].length;
+        arr = new Array(len + 1);
+        arr[0] = arguments[0];
+        for (; i < len; i += 1) {
+            arr[i + 1] = arguments[1][i];
+        }
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this._client;
+    var call_on_write = undefined;
+    // CLIENT REPLY ON|OFF|SKIP
+    /* istanbul ignore next: TODO: Remove this as soon as Travis runs Redis 3.2 */
+    if (arr.length === 2 && arr[0].toString().toUpperCase() === 'REPLY') {
+        var reply_on_off = arr[1].toString().toUpperCase();
+        if (reply_on_off === 'ON' || reply_on_off === 'OFF' || reply_on_off === 'SKIP') {
+            call_on_write = function () {
+                self.reply = reply_on_off;
+            };
+        }
+    }
+    this.queue.push(new Command('client', arr, callback, call_on_write));
+    return this;
+};
+
+RedisClient.prototype.hmset = RedisClient.prototype.HMSET = function hmset () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0];
+        callback = arguments[1];
+    } else if (Array.isArray(arguments[1])) {
+        if (len === 3) {
+            callback = arguments[2];
+        }
+        len = arguments[1].length;
+        arr = new Array(len + 1);
+        arr[0] = arguments[0];
+        for (; i < len; i += 1) {
+            arr[i + 1] = arguments[1][i];
+        }
+    } else if (typeof arguments[1] === 'object' && (arguments.length === 2 || arguments.length === 3 && (typeof arguments[2] === 'function' || typeof arguments[2] === 'undefined'))) {
+        arr = [arguments[0]];
+        for (var field in arguments[1]) {
+            arr.push(field, arguments[1][field]);
+        }
+        callback = arguments[2];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    return this.internal_send_command(new Command('hmset', arr, callback));
+};
+
+Multi.prototype.hmset = Multi.prototype.HMSET = function hmset () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0];
+        callback = arguments[1];
+    } else if (Array.isArray(arguments[1])) {
+        if (len === 3) {
+            callback = arguments[2];
+        }
+        len = arguments[1].length;
+        arr = new Array(len + 1);
+        arr[0] = arguments[0];
+        for (; i < len; i += 1) {
+            arr[i + 1] = arguments[1][i];
+        }
+    } else if (typeof arguments[1] === 'object' && (arguments.length === 2 || arguments.length === 3 && (typeof arguments[2] === 'function' || typeof arguments[2] === 'undefined'))) {
+        arr = [arguments[0]];
+        for (var field in arguments[1]) {
+            arr.push(field, arguments[1][field]);
+        }
+        callback = arguments[2];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    this.queue.push(new Command('hmset', arr, callback));
+    return this;
+};
+
+RedisClient.prototype.subscribe = RedisClient.prototype.SUBSCRIBE = function subscribe () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0].slice(0);
+        callback = arguments[1];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this;
+    var call_on_write = function () {
+        self.pub_sub_mode = self.pub_sub_mode || self.command_queue.length + 1;
+    };
+    return this.internal_send_command(new Command('subscribe', arr, callback, call_on_write));
+};
+
+Multi.prototype.subscribe = Multi.prototype.SUBSCRIBE = function subscribe () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0].slice(0);
+        callback = arguments[1];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this._client;
+    var call_on_write = function () {
+        self.pub_sub_mode = self.pub_sub_mode || self.command_queue.length + 1;
+    };
+    this.queue.push(new Command('subscribe', arr, callback, call_on_write));
+    return this;
+};
+
+RedisClient.prototype.unsubscribe = RedisClient.prototype.UNSUBSCRIBE = function unsubscribe () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0].slice(0);
+        callback = arguments[1];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this;
+    var call_on_write = function () {
+        // Pub sub has to be activated even if not in pub sub mode, as the return value is manipulated in the callback
+        self.pub_sub_mode = self.pub_sub_mode || self.command_queue.length + 1;
+    };
+    return this.internal_send_command(new Command('unsubscribe', arr, callback, call_on_write));
+};
+
+Multi.prototype.unsubscribe = Multi.prototype.UNSUBSCRIBE = function unsubscribe () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0].slice(0);
+        callback = arguments[1];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this._client;
+    var call_on_write = function () {
+        // Pub sub has to be activated even if not in pub sub mode, as the return value is manipulated in the callback
+        self.pub_sub_mode = self.pub_sub_mode || self.command_queue.length + 1;
+    };
+    this.queue.push(new Command('unsubscribe', arr, callback, call_on_write));
+    return this;
+};
+
+RedisClient.prototype.psubscribe = RedisClient.prototype.PSUBSCRIBE = function psubscribe () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0].slice(0);
+        callback = arguments[1];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this;
+    var call_on_write = function () {
+        self.pub_sub_mode = self.pub_sub_mode || self.command_queue.length + 1;
+    };
+    return this.internal_send_command(new Command('psubscribe', arr, callback, call_on_write));
+};
+
+Multi.prototype.psubscribe = Multi.prototype.PSUBSCRIBE = function psubscribe () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0].slice(0);
+        callback = arguments[1];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this._client;
+    var call_on_write = function () {
+        self.pub_sub_mode = self.pub_sub_mode || self.command_queue.length + 1;
+    };
+    this.queue.push(new Command('psubscribe', arr, callback, call_on_write));
+    return this;
+};
+
+RedisClient.prototype.punsubscribe = RedisClient.prototype.PUNSUBSCRIBE = function punsubscribe () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0].slice(0);
+        callback = arguments[1];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this;
+    var call_on_write = function () {
+        // Pub sub has to be activated even if not in pub sub mode, as the return value is manipulated in the callback
+        self.pub_sub_mode = self.pub_sub_mode || self.command_queue.length + 1;
+    };
+    return this.internal_send_command(new Command('punsubscribe', arr, callback, call_on_write));
+};
+
+Multi.prototype.punsubscribe = Multi.prototype.PUNSUBSCRIBE = function punsubscribe () {
+    var arr,
+        len = arguments.length,
+        callback,
+        i = 0;
+    if (Array.isArray(arguments[0])) {
+        arr = arguments[0].slice(0);
+        callback = arguments[1];
+    } else {
+        len = arguments.length;
+        // The later should not be the average use case
+        if (len !== 0 && (typeof arguments[len - 1] === 'function' || typeof arguments[len - 1] === 'undefined')) {
+            len--;
+            callback = arguments[len];
+        }
+        arr = new Array(len);
+        for (; i < len; i += 1) {
+            arr[i] = arguments[i];
+        }
+    }
+    var self = this._client;
+    var call_on_write = function () {
+        // Pub sub has to be activated even if not in pub sub mode, as the return value is manipulated in the callback
+        self.pub_sub_mode = self.pub_sub_mode || self.command_queue.length + 1;
+    };
+    this.queue.push(new Command('punsubscribe', arr, callback, call_on_write));
+    return this;
+};
diff --git a/node_modules/redis/lib/multi.js b/node_modules/redis/lib/multi.js
new file mode 100644
index 0000000..63f5d21
--- /dev/null
+++ b/node_modules/redis/lib/multi.js
@@ -0,0 +1,187 @@
+'use strict';
+
+var Queue = require('double-ended-queue');
+var utils = require('./utils');
+var Command = require('./command');
+
+function Multi (client, args) {
+    this._client = client;
+    this.queue = new Queue();
+    var command, tmp_args;
+    if (args) { // Either undefined or an array. Fail hard if it's not an array
+        for (var i = 0; i < args.length; i++) {
+            command = args[i][0];
+            tmp_args = args[i].slice(1);
+            if (Array.isArray(command)) {
+                this[command[0]].apply(this, command.slice(1).concat(tmp_args));
+            } else {
+                this[command].apply(this, tmp_args);
+            }
+        }
+    }
+}
+
+function pipeline_transaction_command (self, command_obj, index) {
+    // Queueing is done first, then the commands are executed
+    var tmp = command_obj.callback;
+    command_obj.callback = function (err, reply) {
+        // Ignore the multi command. This is applied by node_redis and the user does not benefit by it
+        if (err && index !== -1) {
+            if (tmp) {
+                tmp(err);
+            }
+            err.position = index;
+            self.errors.push(err);
+        }
+        // Keep track of who wants buffer responses:
+        // By the time the callback is called the command_obj got the buffer_args attribute attached
+        self.wants_buffers[index] = command_obj.buffer_args;
+        command_obj.callback = tmp;
+    };
+    self._client.internal_send_command(command_obj);
+}
+
+Multi.prototype.exec_atomic = Multi.prototype.EXEC_ATOMIC = Multi.prototype.execAtomic = function exec_atomic (callback) {
+    if (this.queue.length < 2) {
+        return this.exec_batch(callback);
+    }
+    return this.exec(callback);
+};
+
+function multi_callback (self, err, replies) {
+    var i = 0, command_obj;
+
+    if (err) {
+        err.errors = self.errors;
+        if (self.callback) {
+            self.callback(err);
+            // Exclude connection errors so that those errors won't be emitted twice
+        } else if (err.code !== 'CONNECTION_BROKEN') {
+            self._client.emit('error', err);
+        }
+        return;
+    }
+
+    if (replies) {
+        while (command_obj = self.queue.shift()) {
+            if (replies[i] instanceof Error) {
+                var match = replies[i].message.match(utils.err_code);
+                // LUA script could return user errors that don't behave like all other errors!
+                if (match) {
+                    replies[i].code = match[1];
+                }
+                replies[i].command = command_obj.command.toUpperCase();
+                if (typeof command_obj.callback === 'function') {
+                    command_obj.callback(replies[i]);
+                }
+            } else {
+                // If we asked for strings, even in detect_buffers mode, then return strings:
+                replies[i] = self._client.handle_reply(replies[i], command_obj.command, self.wants_buffers[i]);
+                if (typeof command_obj.callback === 'function') {
+                    command_obj.callback(null, replies[i]);
+                }
+            }
+            i++;
+        }
+    }
+
+    if (self.callback) {
+        self.callback(null, replies);
+    }
+}
+
+Multi.prototype.exec_transaction = function exec_transaction (callback) {
+    if (this.monitoring || this._client.monitoring) {
+        var err = new RangeError(
+            'Using transaction with a client that is in monitor mode does not work due to faulty return values of Redis.'
+        );
+        err.command = 'EXEC';
+        err.code = 'EXECABORT';
+        return utils.reply_in_order(this._client, callback, err);
+    }
+    var self = this;
+    var len = self.queue.length;
+    self.errors = [];
+    self.callback = callback;
+    self._client.cork();
+    self.wants_buffers = new Array(len);
+    pipeline_transaction_command(self, new Command('multi', []), -1);
+    // Drain queue, callback will catch 'QUEUED' or error
+    for (var index = 0; index < len; index++) {
+        // The commands may not be shifted off, since they are needed in the result handler
+        pipeline_transaction_command(self, self.queue.get(index), index);
+    }
+
+    self._client.internal_send_command(new Command('exec', [], function (err, replies) {
+        multi_callback(self, err, replies);
+    }));
+    self._client.uncork();
+    return !self._client.should_buffer;
+};
+
+function batch_callback (self, cb, i) {
+    return function batch_callback (err, res) {
+        if (err) {
+            self.results[i] = err;
+            // Add the position to the error
+            self.results[i].position = i;
+        } else {
+            self.results[i] = res;
+        }
+        cb(err, res);
+    };
+}
+
+Multi.prototype.exec = Multi.prototype.EXEC = Multi.prototype.exec_batch = function exec_batch (callback) {
+    var self = this;
+    var len = self.queue.length;
+    var index = 0;
+    var command_obj;
+    if (len === 0) {
+        utils.reply_in_order(self._client, callback, null, []);
+        return !self._client.should_buffer;
+    }
+    self._client.cork();
+    if (!callback) {
+        while (command_obj = self.queue.shift()) {
+            self._client.internal_send_command(command_obj);
+        }
+        self._client.uncork();
+        return !self._client.should_buffer;
+    }
+    var callback_without_own_cb = function (err, res) {
+        if (err) {
+            self.results.push(err);
+            // Add the position to the error
+            var i = self.results.length - 1;
+            self.results[i].position = i;
+        } else {
+            self.results.push(res);
+        }
+        // Do not emit an error here. Otherwise each error would result in one emit.
+        // The errors will be returned in the result anyway
+    };
+    var last_callback = function (cb) {
+        return function (err, res) {
+            cb(err, res);
+            callback(null, self.results);
+        };
+    };
+    self.results = [];
+    while (command_obj = self.queue.shift()) {
+        if (typeof command_obj.callback === 'function') {
+            command_obj.callback = batch_callback(self, command_obj.callback, index);
+        } else {
+            command_obj.callback = callback_without_own_cb;
+        }
+        if (typeof callback === 'function' && index === len - 1) {
+            command_obj.callback = last_callback(command_obj.callback);
+        }
+        this._client.internal_send_command(command_obj);
+        index++;
+    }
+    self._client.uncork();
+    return !self._client.should_buffer;
+};
+
+module.exports = Multi;
diff --git a/node_modules/redis/lib/utils.js b/node_modules/redis/lib/utils.js
new file mode 100644
index 0000000..52e58ec
--- /dev/null
+++ b/node_modules/redis/lib/utils.js
@@ -0,0 +1,134 @@
+'use strict';
+
+// hgetall converts its replies to an Object. If the reply is empty, null is returned.
+// These function are only called with internal data and have therefore always the same instanceof X
+function replyToObject (reply) {
+    // The reply might be a string or a buffer if this is called in a transaction (multi)
+    if (reply.length === 0 || !(reply instanceof Array)) {
+        return null;
+    }
+    var obj = {};
+    for (var i = 0; i < reply.length; i += 2) {
+        obj[reply[i].toString('binary')] = reply[i + 1];
+    }
+    return obj;
+}
+
+function replyToStrings (reply) {
+    if (reply instanceof Buffer) {
+        return reply.toString();
+    }
+    if (reply instanceof Array) {
+        var res = new Array(reply.length);
+        for (var i = 0; i < reply.length; i++) {
+            // Recusivly call the function as slowlog returns deep nested replies
+            res[i] = replyToStrings(reply[i]);
+        }
+        return res;
+    }
+
+    return reply;
+}
+
+function print (err, reply) {
+    if (err) {
+        // A error always begins with Error:
+        console.log(err.toString());
+    } else {
+        console.log('Reply: ' + reply);
+    }
+}
+
+var camelCase;
+// Deep clone arbitrary objects with arrays. Can't handle cyclic structures (results in a range error)
+// Any attribute with a non primitive value besides object and array will be passed by reference (e.g. Buffers, Maps, Functions)
+// All capital letters are going to be replaced with a lower case letter and a underscore infront of it
+function clone (obj) {
+    var copy;
+    if (Array.isArray(obj)) {
+        copy = new Array(obj.length);
+        for (var i = 0; i < obj.length; i++) {
+            copy[i] = clone(obj[i]);
+        }
+        return copy;
+    }
+    if (Object.prototype.toString.call(obj) === '[object Object]') {
+        copy = {};
+        var elems = Object.keys(obj);
+        var elem;
+        while (elem = elems.pop()) {
+            if (elem === 'tls') { // special handle tls
+                copy[elem] = obj[elem];
+                continue;
+            }
+            // Accept camelCase options and convert them to snake_case
+            var snake_case = elem.replace(/[A-Z][^A-Z]/g, '_$&').toLowerCase();
+            // If camelCase is detected, pass it to the client, so all variables are going to be camelCased
+            // There are no deep nested options objects yet, but let's handle this future proof
+            if (snake_case !== elem.toLowerCase()) {
+                camelCase = true;
+            }
+            copy[snake_case] = clone(obj[elem]);
+        }
+        return copy;
+    }
+    return obj;
+}
+
+function convenienceClone (obj) {
+    camelCase = false;
+    obj = clone(obj) || {};
+    if (camelCase) {
+        obj.camel_case = true;
+    }
+    return obj;
+}
+
+function callbackOrEmit (self, callback, err, res) {
+    if (callback) {
+        callback(err, res);
+    } else if (err) {
+        self.emit('error', err);
+    }
+}
+
+function replyInOrder (self, callback, err, res, queue) {
+    // If the queue is explicitly passed, use that, otherwise fall back to the offline queue first,
+    // as there might be commands in both queues at the same time
+    var command_obj;
+    /* istanbul ignore if: TODO: Remove this as soon as we test Redis 3.2 on travis */
+    if (queue) {
+        command_obj = queue.peekBack();
+    } else {
+        command_obj = self.offline_queue.peekBack() || self.command_queue.peekBack();
+    }
+    if (!command_obj) {
+        process.nextTick(function () {
+            callbackOrEmit(self, callback, err, res);
+        });
+    } else {
+        var tmp = command_obj.callback;
+        command_obj.callback = tmp ?
+            function (e, r) {
+                tmp(e, r);
+                callbackOrEmit(self, callback, err, res);
+            } :
+            function (e, r) {
+                if (e) {
+                    self.emit('error', e);
+                }
+                callbackOrEmit(self, callback, err, res);
+            };
+    }
+}
+
+module.exports = {
+    reply_to_strings: replyToStrings,
+    reply_to_object: replyToObject,
+    print: print,
+    err_code: /^([A-Z]+)\s+(.+)$/,
+    monitor_regex: /^[0-9]{10,11}\.[0-9]+ \[[0-9]+ .+\]( ".+?")+$/,
+    clone: convenienceClone,
+    callback_or_emit: callbackOrEmit,
+    reply_in_order: replyInOrder
+};
diff --git a/node_modules/redis/package.json b/node_modules/redis/package.json
new file mode 100644
index 0000000..b231257
--- /dev/null
+++ b/node_modules/redis/package.json
@@ -0,0 +1,135 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "redis",
+        "scope": null,
+        "escapedName": "redis",
+        "name": "redis",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/Users/fzy/project/koa2_Sequelize_project"
+    ]
+  ],
+  "_from": "redis@latest",
+  "_id": "redis@2.8.0",
+  "_inCache": true,
+  "_location": "/redis",
+  "_nodeVersion": "8.2.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/redis-2.8.0.tgz_1502169461811_0.2593278889544308"
+  },
+  "_npmUser": {
+    "name": "bridgear",
+    "email": "ruben@bridgewater.de"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "redis",
+    "scope": null,
+    "escapedName": "redis",
+    "name": "redis",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz",
+  "_shasum": "202288e3f58c49f6079d97af7a10e1303ae14b02",
+  "_shrinkwrap": null,
+  "_spec": "redis",
+  "_where": "/Users/fzy/project/koa2_Sequelize_project",
+  "author": {
+    "name": "Matt Ranney",
+    "email": "mjr@ranney.com"
+  },
+  "bugs": {
+    "url": "https://github.com/NodeRedis/node_redis/issues"
+  },
+  "dependencies": {
+    "double-ended-queue": "^2.1.0-0",
+    "redis-commands": "^1.2.0",
+    "redis-parser": "^2.6.0"
+  },
+  "description": "Redis client library",
+  "devDependencies": {
+    "bluebird": "^3.0.2",
+    "coveralls": "^2.11.2",
+    "eslint": "^4.2.0",
+    "intercept-stdout": "~0.1.2",
+    "metrics": "^0.1.9",
+    "mocha": "^3.1.2",
+    "nyc": "^10.0.0",
+    "tcp-port-used": "^0.1.2",
+    "uuid": "^2.0.1",
+    "win-spawn": "^2.0.0"
+  },
+  "directories": {
+    "example": "examples",
+    "test": "test"
+  },
+  "dist": {
+    "integrity": "sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A==",
+    "shasum": "202288e3f58c49f6079d97af7a10e1303ae14b02",
+    "tarball": "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "gitHead": "1380ad67a3f2b4a8b3dc31767e352e3bc4e63576",
+  "homepage": "https://github.com/NodeRedis/node_redis",
+  "keywords": [
+    "database",
+    "redis",
+    "transaction",
+    "pipelining",
+    "performance",
+    "queue",
+    "nodejs",
+    "pubsub",
+    "backpressure"
+  ],
+  "license": "MIT",
+  "main": "./index.js",
+  "maintainers": [
+    {
+      "name": "bridgear",
+      "email": "ruben@bridgewater.de"
+    },
+    {
+      "name": "bcoe",
+      "email": "ben@npmjs.com"
+    },
+    {
+      "name": "mjr",
+      "email": "mjr@ranney.com"
+    },
+    {
+      "name": "bryce",
+      "email": "bryce@ravenwall.com"
+    }
+  ],
+  "name": "redis",
+  "optionalDependencies": {},
+  "readme": "redis - a node.js redis client\n===========================\n\n[![Build Status](https://travis-ci.org/NodeRedis/node_redis.svg?branch=master)](https://travis-ci.org/NodeRedis/node_redis)\n[![Coverage Status](https://coveralls.io/repos/NodeRedis/node_redis/badge.svg?branch=)](https://coveralls.io/r/NodeRedis/node_redis?branch=)\n[![Windows Tests](https://img.shields.io/appveyor/ci/BridgeAR/node-redis/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/BridgeAR/node-redis/branch/master)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/NodeRedis/node_redis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n\nThis is a complete and feature rich Redis client for node.js. __It supports all\nRedis commands__ and focuses on high performance.\n\nInstall with:\n\n    npm install redis\n\n## Usage Example\n\n```js\nvar redis = require(\"redis\"),\n    client = redis.createClient();\n\n// if you'd like to select database 3, instead of 0 (default), call\n// client.select(3, function() { /* ... */ });\n\nclient.on(\"error\", function (err) {\n    console.log(\"Error \" + err);\n});\n\nclient.set(\"string key\", \"string val\", redis.print);\nclient.hset(\"hash key\", \"hashtest 1\", \"some value\", redis.print);\nclient.hset([\"hash key\", \"hashtest 2\", \"some other value\"], redis.print);\nclient.hkeys(\"hash key\", function (err, replies) {\n    console.log(replies.length + \" replies:\");\n    replies.forEach(function (reply, i) {\n        console.log(\"    \" + i + \": \" + reply);\n    });\n    client.quit();\n});\n```\n\nThis will display:\n\n    mjr:~/work/node_redis (master)$ node example.js\n    Reply: OK\n    Reply: 0\n    Reply: 0\n    2 replies:\n        0: hashtest 1\n        1: hashtest 2\n    mjr:~/work/node_redis (master)$\n\nNote that the API is entirely asynchronous. To get data back from the server,\nyou'll need to use a callback. From v.2.6 on the API supports camelCase and\nsnake_case and all options / variables / events etc. can be used either way. It\nis recommended to use camelCase as this is the default for the Node.js\nlandscape.\n\n### Promises\n\nYou can also use node_redis with promises by promisifying node_redis with\n[bluebird](https://github.com/petkaantonov/bluebird) as in:\n\n```js\nvar redis = require('redis');\nbluebird.promisifyAll(redis.RedisClient.prototype);\nbluebird.promisifyAll(redis.Multi.prototype);\n```\n\nIt'll add a *Async* to all node_redis functions (e.g. return client.getAsync().then())\n\n```js\n// We expect a value 'foo': 'bar' to be present\n// So instead of writing client.get('foo', cb); you have to write:\nreturn client.getAsync('foo').then(function(res) {\n    console.log(res); // => 'bar'\n});\n\n// Using multi with promises looks like:\n\nreturn client.multi().get('foo').execAsync().then(function(res) {\n    console.log(res); // => 'bar'\n});\n```\n\n### Sending Commands\n\nEach Redis command is exposed as a function on the `client` object.\nAll functions take either an `args` Array plus optional `callback` Function or\na variable number of individual arguments followed by an optional callback.\nExamples:\n\n```js\nclient.hmset([\"key\", \"test keys 1\", \"test val 1\", \"test keys 2\", \"test val 2\"], function (err, res) {});\n// Works the same as\nclient.hmset(\"key\", [\"test keys 1\", \"test val 1\", \"test keys 2\", \"test val 2\"], function (err, res) {});\n// Or\nclient.hmset(\"key\", \"test keys 1\", \"test val 1\", \"test keys 2\", \"test val 2\", function (err, res) {});\n```\n\nNote that in either form the `callback` is optional:\n\n```js\nclient.set(\"some key\", \"some val\");\nclient.set([\"some other key\", \"some val\"]);\n```\n\nIf the key is missing, reply will be null. Only if the [Redis Command\nReference](http://redis.io/commands) states something else it will not be null.\n\n```js\nclient.get(\"missingkey\", function(err, reply) {\n    // reply is null when the key is missing\n    console.log(reply);\n});\n```\n\nFor a list of Redis commands, see [Redis Command Reference](http://redis.io/commands)\n\nMinimal parsing is done on the replies. Commands that return a integer return\nJavaScript Numbers, arrays return JavaScript Array. `HGETALL` returns an Object\nkeyed by the hash keys. All strings will either be returned as string or as\nbuffer depending on your setting. Please be aware that sending null, undefined\nand Boolean values will result in the value coerced to a string!\n\n# Redis Commands\n\nThis library is a 1 to 1 mapping to [Redis commands](https://redis.io/commands).\nIt is not a cache library so please refer to Redis commands page for full usage\ndetails.\n\nExample setting key to auto expire using [SET command](https://redis.io/commands/set)\n\n```js\n// this key will expire after 10 seconds\nclient.set('key', 'value!', 'EX', 10);\n```\n\n# API\n\n## Connection and other Events\n\n`client` will emit some events about the state of the connection to the Redis server.\n\n### \"ready\"\n\n`client` will emit `ready` once a connection is established. Commands issued\nbefore the `ready` event are queued, then replayed just before this event is\nemitted.\n\n### \"connect\"\n\n`client` will emit `connect` as soon as the stream is connected to the server.\n\n### \"reconnecting\"\n\n`client` will emit `reconnecting` when trying to reconnect to the Redis server\nafter losing the connection. Listeners are passed an object containing `delay`\n(in ms) and `attempt` (the attempt #) attributes.\n\n### \"error\"\n\n`client` will emit `error` when encountering an error connecting to the Redis\nserver or when any other in node_redis occurs. If you use a command without\ncallback and encounter a ReplyError it is going to be emitted to the error\nlistener.\n\nSo please attach the error listener to node_redis.\n\n### \"end\"\n\n`client` will emit `end` when an established Redis server connection has closed.\n\n### \"drain\" (deprecated)\n\n`client` will emit `drain` when the TCP connection to the Redis server has been\nbuffering, but is now writable. This event can be used to stream commands in to\nRedis and adapt to backpressure.\n\nIf the stream is buffering `client.should_buffer` is set to true. Otherwise the\nvariable is always set to false. That way you can decide when to reduce your\nsend rate and resume sending commands when you get `drain`.\n\nYou can also check the return value of each command as it will also return the\nbackpressure indicator (deprecated). If false is returned the stream had to\nbuffer.\n\n### \"warning\"\n\n`client` will emit `warning` when password was set but none is needed and if a\ndeprecated option / function / similar is used.\n\n### \"idle\" (deprecated)\n\n`client` will emit `idle` when there are no outstanding commands that are\nawaiting a response.\n\n## redis.createClient()\nIf you have `redis-server` running on the same machine as node, then the\ndefaults for port and host are probably fine and you don't need to supply any\narguments. `createClient()` returns a `RedisClient` object. Otherwise,\n`createClient()` accepts these arguments:\n\n* `redis.createClient([options])`\n* `redis.createClient(unix_socket[, options])`\n* `redis.createClient(redis_url[, options])`\n* `redis.createClient(port[, host][, options])`\n\n__Tip:__ If the Redis server runs on the same machine as the client consider\nusing unix sockets if possible to increase throughput.\n\n#### `options` object properties\n| Property  | Default   | Description |\n|-----------|-----------|-------------|\n| host      | 127.0.0.1 | IP address of the Redis server |\n| port      | 6379      | Port of the Redis server |\n| path      | null      | The UNIX socket string of the Redis server |\n| url       | null      | The URL of the Redis server. Format: `[redis:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]` (More info avaliable at [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis)). |\n| parser    | javascript | __Deprecated__ Use either the built-in JS parser [`javascript`]() or the native [`hiredis`]() parser. __Note__ `node_redis` < 2.6 uses hiredis as default if installed. This changed in v.2.6.0. |\n| string_numbers | null | Set to `true`, `node_redis` will return Redis number values as Strings instead of javascript Numbers. Useful if you need to handle big numbers (above `Number.MAX_SAFE_INTEGER === 2^53`). Hiredis is incapable of this behavior, so setting this option to `true` will result in the built-in javascript parser being used no matter the value of the `parser` option. |\n| return_buffers | false | If set to `true`, then all replies will be sent to callbacks as Buffers instead of Strings. |\n| detect_buffers | false | If set to `true`, then replies will be sent to callbacks as Buffers. This option lets you switch between Buffers and Strings on a per-command basis, whereas `return_buffers` applies to every command on a client. __Note__: This doesn't work properly with the pubsub mode. A subscriber has to either always return Strings or Buffers. |\n| socket_keepalive | true | If set to `true`, the keep-alive functionality is enabled on the underlying socket. |\n| no_ready_check | false |  When a connection is established to the Redis server, the server might still be loading the database from disk. While loading, the server will not respond to any commands. To work around this, `node_redis` has a \"ready check\" which sends the `INFO` command to the server. The response from the `INFO` command indicates whether the server is ready for more commands. When ready, `node_redis` emits a `ready` event. Setting `no_ready_check` to `true` will inhibit this check. |\n| enable_offline_queue |  true | By default, if there is no active connection to the Redis server, commands are added to a queue and are executed once the connection has been established. Setting `enable_offline_queue` to `false` will disable this feature and the callback will be executed immediately with an error, or an error will be emitted if no callback is specified. |\n| retry_max_delay | null | __Deprecated__ _Please use `retry_strategy` instead._ By default, every time the client tries to connect and fails, the reconnection delay almost doubles. This delay normally grows infinitely, but setting `retry_max_delay` limits it to the maximum value provided in milliseconds. |\n| connect_timeout | 3600000 | __Deprecated__ _Please use `retry_strategy` instead._ Setting `connect_timeout` limits the total time for the client to connect and reconnect. The value is provided in milliseconds and is counted from the moment a new client is created or from the time the connection is lost. The last retry is going to happen exactly at the timeout time. Default is to try connecting until the default system socket timeout has been exceeded and to try reconnecting until 1h has elapsed. |\n| max_attempts | 0 | __Deprecated__ _Please use `retry_strategy` instead._ By default, a client will try reconnecting until connected. Setting `max_attempts` limits total amount of connection attempts. Setting this to 1 will prevent any reconnect attempt. |\n| retry_unfulfilled_commands | false | If set to `true`, all commands that were unfulfilled while the connection is lost will be retried after the connection has been reestablished. Use this with caution if you use state altering commands (e.g. `incr`). This is especially useful if you use blocking commands. |\n| password | null | If set, client will run Redis auth command on connect. Alias `auth_pass` __Note__ `node_redis` < 2.5 must use `auth_pass` |\n| db | null | If set, client will run Redis `select` command on connect. |\n| family | IPv4 | You can force using IPv6 if you set the family to 'IPv6'. See Node.js [net](https://nodejs.org/api/net.html) or [dns](https://nodejs.org/api/dns.html) modules on how to use the family type. |\n| disable_resubscribing | false | If set to `true`, a client won't resubscribe after disconnecting. |\n| rename_commands | null | Passing an object with renamed commands to use instead of the original functions. For example, if you renamed the command KEYS to \"DO-NOT-USE\" then the rename_commands object would be: `{ KEYS : \"DO-NOT-USE\" }` . See the [Redis security topics](http://redis.io/topics/security) for more info. |\n| tls | null | An object containing options to pass to [tls.connect](http://nodejs.org/api/tls.html#tls_tls_connect_port_host_options_callback) to set up a TLS connection to Redis (if, for example, it is set up to be accessible via a tunnel). |\n| prefix | null | A string used to prefix all used keys (e.g. `namespace:test`). Please be aware that the `keys` command will not be prefixed. The `keys` command has a \"pattern\" as argument and no key and it would be impossible to determine the existing keys in Redis if this would be prefixed. |\n| retry_strategy | function | A function that receives an options object as parameter including the retry `attempt`, the `total_retry_time` indicating how much time passed since the last time connected, the `error` why the connection was lost and the number of `times_connected` in total. If you return a number from this function, the retry will happen exactly after that time in milliseconds. If you return a non-number, no further retry will happen and all offline commands are flushed with errors. Return an error to return that specific error to all offline commands. Example below. |\n\n```js\nvar redis = require(\"redis\");\nvar client = redis.createClient({detect_buffers: true});\n\nclient.set(\"foo_rand000000000000\", \"OK\");\n\n// This will return a JavaScript String\nclient.get(\"foo_rand000000000000\", function (err, reply) {\n    console.log(reply.toString()); // Will print `OK`\n});\n\n// This will return a Buffer since original key is specified as a Buffer\nclient.get(new Buffer(\"foo_rand000000000000\"), function (err, reply) {\n    console.log(reply.toString()); // Will print `<Buffer 4f 4b>`\n});\nclient.quit();\n```\n\nretry_strategy example\n\n```js\nvar client = redis.createClient({\n    retry_strategy: function (options) {\n        if (options.error && options.error.code === 'ECONNREFUSED') {\n            // End reconnecting on a specific error and flush all commands with\n            // a individual error\n            return new Error('The server refused the connection');\n        }\n        if (options.total_retry_time > 1000 * 60 * 60) {\n            // End reconnecting after a specific timeout and flush all commands\n            // with a individual error\n            return new Error('Retry time exhausted');\n        }\n        if (options.attempt > 10) {\n            // End reconnecting with built in error\n            return undefined;\n        }\n        // reconnect after\n        return Math.min(options.attempt * 100, 3000);\n    }\n});\n```\n\n## client.auth(password[, callback])\n\nWhen connecting to a Redis server that requires authentication, the `AUTH`\ncommand must be sent as the first command after connecting. This can be tricky\nto coordinate with reconnections, the ready check, etc. To make this easier,\n`client.auth()` stashes `password` and will send it after each connection,\nincluding reconnections. `callback` is invoked only once, after the response to\nthe very first `AUTH` command sent.\nNOTE: Your call to `client.auth()` should not be inside the ready handler. If\nyou are doing this wrong, `client` will emit an error that looks\nsomething like this `Error: Ready check failed: ERR operation not permitted`.\n\n## backpressure\n\n### stream\n\nThe client exposed the used [stream](https://nodejs.org/api/stream.html) in\n`client.stream` and if the stream or client had to\n[buffer](https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback)\nthe command in `client.should_buffer`. In combination this can be used to\nimplement backpressure by checking the buffer state before sending a command and\nlistening to the stream\n[drain](https://nodejs.org/api/stream.html#stream_event_drain) event.\n\n## client.quit()\n\nThis sends the quit command to the redis server and ends cleanly right after all\nrunning commands were properly handled. If this is called while reconnecting\n(and therefore no connection to the redis server exists) it is going to end the\nconnection right away instead of resulting in further reconnections! All offline\ncommands are going to be flushed with an error in that case.\n\n## client.end(flush)\n\nForcibly close the connection to the Redis server. Note that this does not wait\nuntil all replies have been parsed. If you want to exit cleanly, call\n`client.quit()` as mentioned above.\n\nYou should set flush to true, if you are not absolutely sure you do not care\nabout any other commands. If you set flush to false all still running commands\nwill silently fail.\n\nThis example closes the connection to the Redis server before the replies have\nbeen read. You probably don't want to do this:\n\n```js\nvar redis = require(\"redis\"),\n    client = redis.createClient();\n\nclient.set(\"foo_rand000000000000\", \"some fantastic value\", function (err, reply) {\n    // This will either result in an error (flush parameter is set to true)\n    // or will silently fail and this callback will not be called at all (flush set to false)\n    console.log(err);\n});\nclient.end(true); // No further commands will be processed\nclient.get(\"foo_rand000000000000\", function (err, reply) {\n    console.log(err); // => 'The connection has already been closed.'\n});\n```\n\n`client.end()` without the flush parameter set to true should NOT be used in production!\n\n## Error handling (>= v.2.6)\n\nCurrently the following error subclasses exist:\n\n* `RedisError`: _All errors_ returned by the client\n* `ReplyError` subclass of `RedisError`: All errors returned by __Redis__ itself\n* `AbortError` subclass of `RedisError`: All commands that could not finish due\n  to what ever reason\n* `ParserError` subclass of `RedisError`: Returned in case of a parser error\n  (this should not happen)\n* `AggregateError` subclass of `AbortError`: Emitted in case multiple unresolved\n  commands without callback got rejected in debug_mode instead of lots of\n  `AbortError`s.\n\nAll error classes are exported by the module.\n\nExample:\n```js\nvar redis = require('./');\nvar assert = require('assert');\nvar client = redis.createClient();\n\nclient.on('error', function (err) {\n    assert(err instanceof Error);\n    assert(err instanceof redis.AbortError);\n    assert(err instanceof redis.AggregateError);\n    // The set and get get aggregated in here\n    assert.strictEqual(err.errors.length, 2);\n    assert.strictEqual(err.code, 'NR_CLOSED');\n});\nclient.set('foo', 123, 'bar', function (err, res) { // Too many arguments\n    assert(err instanceof redis.ReplyError); // => true\n    assert.strictEqual(err.command, 'SET');\n    assert.deepStrictEqual(err.args, ['foo', 123, 'bar']);\n\n    redis.debug_mode = true;\n    client.set('foo', 'bar');\n    client.get('foo');\n    process.nextTick(function () {\n        // Force closing the connection while the command did not yet return\n        client.end(true);\n        redis.debug_mode = false;\n    });\n});\n\n```\n\nEvery `ReplyError` contains the `command` name in all-caps and the arguments (`args`).\n\nIf node_redis emits a library error because of another error, the triggering\nerror is added to the returned error as `origin` attribute.\n\n___Error codes___\n\nnode_redis returns a `NR_CLOSED` error code if the clients connection dropped.\nIf a command unresolved command got rejected a `UNCERTAIN_STATE` code is\nreturned. A `CONNECTION_BROKEN` error code is used in case node_redis gives up\nto reconnect.\n\n## client.unref()\n\nCall `unref()` on the underlying socket connection to the Redis server, allowing\nthe program to exit once no more commands are pending.\n\nThis is an **experimental** feature, and only supports a subset of the Redis\nprotocol. Any commands where client state is saved on the Redis server, e.g.\n`*SUBSCRIBE` or the blocking `BL*` commands will *NOT* work with `.unref()`.\n\n```js\nvar redis = require(\"redis\")\nvar client = redis.createClient()\n\n/*\n    Calling unref() will allow this program to exit immediately after the get\n    command finishes. Otherwise the client would hang as long as the\n    client-server connection is alive.\n*/\nclient.unref()\nclient.get(\"foo\", function (err, value){\n    if (err) throw(err)\n    console.log(value)\n})\n```\n\n## Friendlier hash commands\n\nMost Redis commands take a single String or an Array of Strings as arguments,\nand replies are sent back as a single String or an Array of Strings. When\ndealing with hash values, there are a couple of useful exceptions to this.\n\n### client.hgetall(hash, callback)\n\nThe reply from an HGETALL command will be converted into a JavaScript Object by\n`node_redis`. That way you can interact with the responses using JavaScript\nsyntax.\n\nExample:\n\n```js\nclient.hmset(\"hosts\", \"mjr\", \"1\", \"another\", \"23\", \"home\", \"1234\");\nclient.hgetall(\"hosts\", function (err, obj) {\n    console.dir(obj);\n});\n```\n\nOutput:\n\n```js\n{ mjr: '1', another: '23', home: '1234' }\n```\n\n### client.hmset(hash, obj[, callback])\n\nMultiple values in a hash can be set by supplying an object:\n\n```js\nclient.HMSET(key2, {\n    \"0123456789\": \"abcdefghij\", // NOTE: key and value will be coerced to strings\n    \"some manner of key\": \"a type of value\"\n});\n```\n\nThe properties and values of this Object will be set as keys and values in the\nRedis hash.\n\n### client.hmset(hash, key1, val1, ... keyn, valn, [callback])\n\nMultiple values may also be set by supplying a list:\n\n```js\nclient.HMSET(key1, \"0123456789\", \"abcdefghij\", \"some manner of key\", \"a type of value\");\n```\n\n## Publish / Subscribe\n\nExample of the publish / subscribe API. This program opens two\nclient connections, subscribes to a channel on one of them, and publishes to that\nchannel on the other:\n\n```js\nvar redis = require(\"redis\");\nvar sub = redis.createClient(), pub = redis.createClient();\nvar msg_count = 0;\n\nsub.on(\"subscribe\", function (channel, count) {\n    pub.publish(\"a nice channel\", \"I am sending a message.\");\n    pub.publish(\"a nice channel\", \"I am sending a second message.\");\n    pub.publish(\"a nice channel\", \"I am sending my last message.\");\n});\n\nsub.on(\"message\", function (channel, message) {\n    console.log(\"sub channel \" + channel + \": \" + message);\n    msg_count += 1;\n    if (msg_count === 3) {\n        sub.unsubscribe();\n        sub.quit();\n        pub.quit();\n    }\n});\n\nsub.subscribe(\"a nice channel\");\n```\n\nWhen a client issues a `SUBSCRIBE` or `PSUBSCRIBE`, that connection is put into\na \"subscriber\" mode. At that point, only commands that modify the subscription\nset are valid and quit (and depending on the redis version ping as well). When\nthe subscription set is empty, the connection is put back into regular mode.\n\nIf you need to send regular commands to Redis while in subscriber mode, just\nopen another connection with a new client (hint: use `client.duplicate()`).\n\n## Subscriber Events\n\nIf a client has subscriptions active, it may emit these events:\n\n### \"message\" (channel, message)\n\nClient will emit `message` for every message received that matches an active subscription.\nListeners are passed the channel name as `channel` and the message as `message`.\n\n### \"pmessage\" (pattern, channel, message)\n\nClient will emit `pmessage` for every message received that matches an active\nsubscription pattern. Listeners are passed the original pattern used with\n`PSUBSCRIBE` as `pattern`, the sending channel name as `channel`, and the\nmessage as `message`.\n\n### \"message_buffer\" (channel, message)\n\nThis is the same as the `message` event with the exception, that it is always\ngoing to emit a buffer. If you listen to the `message` event at the same time as\nthe `message_buffer`, it is always going to emit a string.\n\n### \"pmessage_buffer\" (pattern, channel, message)\n\nThis is the same as the `pmessage` event with the exception, that it is always\ngoing to emit a buffer. If you listen to the `pmessage` event at the same time\nas the `pmessage_buffer`, it is always going to emit a string.\n\n### \"subscribe\" (channel, count)\n\nClient will emit `subscribe` in response to a `SUBSCRIBE` command. Listeners are\npassed the channel name as `channel` and the new count of subscriptions for this\nclient as `count`.\n\n### \"psubscribe\" (pattern, count)\n\nClient will emit `psubscribe` in response to a `PSUBSCRIBE` command. Listeners\nare passed the original pattern as `pattern`, and the new count of subscriptions\nfor this client as `count`.\n\n### \"unsubscribe\" (channel, count)\n\nClient will emit `unsubscribe` in response to a `UNSUBSCRIBE` command. Listeners\nare passed the channel name as `channel` and the new count of subscriptions for\nthis client as `count`. When `count` is 0, this client has left subscriber mode\nand no more subscriber events will be emitted.\n\n### \"punsubscribe\" (pattern, count)\n\nClient will emit `punsubscribe` in response to a `PUNSUBSCRIBE` command.\nListeners are passed the channel name as `channel` and the new count of\nsubscriptions for this client as `count`. When `count` is 0, this client has\nleft subscriber mode and no more subscriber events will be emitted.\n\n## client.multi([commands])\n\n`MULTI` commands are queued up until an `EXEC` is issued, and then all commands\nare run atomically by Redis. The interface in `node_redis` is to return an\nindividual `Multi` object by calling `client.multi()`. If any command fails to\nqueue, all commands are rolled back and none is going to be executed (For\nfurther information look at\n[transactions](http://redis.io/topics/transactions)).\n\n```js\nvar redis  = require(\"./index\"),\n    client = redis.createClient(), set_size = 20;\n\nclient.sadd(\"bigset\", \"a member\");\nclient.sadd(\"bigset\", \"another member\");\n\nwhile (set_size > 0) {\n    client.sadd(\"bigset\", \"member \" + set_size);\n    set_size -= 1;\n}\n\n// multi chain with an individual callback\nclient.multi()\n    .scard(\"bigset\")\n    .smembers(\"bigset\")\n    .keys(\"*\", function (err, replies) {\n        // NOTE: code in this callback is NOT atomic\n        // this only happens after the the .exec call finishes.\n        client.mget(replies, redis.print);\n    })\n    .dbsize()\n    .exec(function (err, replies) {\n        console.log(\"MULTI got \" + replies.length + \" replies\");\n        replies.forEach(function (reply, index) {\n            console.log(\"Reply \" + index + \": \" + reply.toString());\n        });\n    });\n```\n\n### Multi.exec([callback])\n\n`client.multi()` is a constructor that returns a `Multi` object. `Multi` objects\nshare all of the same command methods as `client` objects do. Commands are\nqueued up inside the `Multi` object until `Multi.exec()` is invoked.\n\nIf your code contains an syntax error an EXECABORT error is going to be thrown\nand all commands are going to be aborted. That error contains a `.errors`\nproperty that contains the concrete errors.\nIf all commands were queued successfully and an error is thrown by redis while\nprocessing the commands that error is going to be returned in the result array!\nNo other command is going to be aborted though than the onces failing.\n\nYou can either chain together `MULTI` commands as in the above example, or you\ncan queue individual commands while still sending regular client command as in\nthis example:\n\n```js\nvar redis  = require(\"redis\"),\n    client = redis.createClient(), multi;\n\n// start a separate multi command queue\nmulti = client.multi();\nmulti.incr(\"incr thing\", redis.print);\nmulti.incr(\"incr other thing\", redis.print);\n\n// runs immediately\nclient.mset(\"incr thing\", 100, \"incr other thing\", 1, redis.print);\n\n// drains multi queue and runs atomically\nmulti.exec(function (err, replies) {\n    console.log(replies); // 101, 2\n});\n```\n\nIn addition to adding commands to the `MULTI` queue individually, you can also\npass an array of commands and arguments to the constructor:\n\n```js\nvar redis  = require(\"redis\"),\n    client = redis.createClient(), multi;\n\nclient.multi([\n    [\"mget\", \"multifoo\", \"multibar\", redis.print],\n    [\"incr\", \"multifoo\"],\n    [\"incr\", \"multibar\"]\n]).exec(function (err, replies) {\n    console.log(replies);\n});\n```\n\n### Multi.exec_atomic([callback])\n\nIdentical to Multi.exec but with the difference that executing a single command\nwill not use transactions.\n\n## client.batch([commands])\n\nIdentical to .multi without transactions. This is recommended if you want to\nexecute many commands at once but don't have to rely on transactions.\n\n`BATCH` commands are queued up until an `EXEC` is issued, and then all commands\nare run atomically by Redis. The interface in `node_redis` is to return an\nindividual `Batch` object by calling `client.batch()`. The only difference\nbetween .batch and .multi is that no transaction is going to be used.\nBe aware that the errors are - just like in multi statements - in the result.\nOtherwise both, errors and results could be returned at the same time.\n\nIf you fire many commands at once this is going to boost the execution speed\nsignificantly compared to firing the same commands in a loop without waiting for\nthe result! See the benchmarks for further comparison. Please remember that all\ncommands are kept in memory until they are fired.\n\n## Monitor mode\n\nRedis supports the `MONITOR` command, which lets you see all commands received\nby the Redis server across all client connections, including from other client\nlibraries and other computers.\n\nA `monitor` event is going to be emitted for every command fired from any client\nconnected to the server including the monitoring client itself. The callback for\nthe `monitor` event takes a timestamp from the Redis server, an array of command\narguments and the raw monitoring string.\n\nExample:\n\n```js\nvar client  = require(\"redis\").createClient();\nclient.monitor(function (err, res) {\n    console.log(\"Entering monitoring mode.\");\n});\nclient.set('foo', 'bar');\n\nclient.on(\"monitor\", function (time, args, raw_reply) {\n    console.log(time + \": \" + args); // 1458910076.446514:['set', 'foo', 'bar']\n});\n```\n\n# Extras\n\nSome other things you might like to know about.\n\n## client.server_info\n\nAfter the ready probe completes, the results from the INFO command are saved in\nthe `client.server_info` object.\n\nThe `versions` key contains an array of the elements of the version string for\neasy comparison.\n\n    > client.server_info.redis_version\n    '2.3.0'\n    > client.server_info.versions\n    [ 2, 3, 0 ]\n\n## redis.print()\n\nA handy callback function for displaying return values when testing. Example:\n\n```js\nvar redis = require(\"redis\"),\n    client = redis.createClient();\n\nclient.on(\"connect\", function () {\n    client.set(\"foo_rand000000000000\", \"some fantastic value\", redis.print);\n    client.get(\"foo_rand000000000000\", redis.print);\n});\n```\n\nThis will print:\n\n    Reply: OK\n    Reply: some fantastic value\n\nNote that this program will not exit cleanly because the client is still connected.\n\n## Multi-word commands\n\nTo execute redis multi-word commands like `SCRIPT LOAD` or `CLIENT LIST` pass\nthe second word as first parameter:\n\n    client.script('load', 'return 1');\n    client.multi().script('load', 'return 1').exec(...);\n    client.multi([['script', 'load', 'return 1']]).exec(...);\n\n## client.duplicate([options][, callback])\n\nDuplicate all current options and return a new redisClient instance. All options\npassed to the duplicate function are going to replace the original option. If\nyou pass a callback, duplicate is going to wait until the client is ready and\nreturns it in the callback. If an error occurs in the meanwhile, that is going\nto return an error instead in the callback.\n\nOne example of when to use duplicate() would be to accommodate the connection-\nblocking redis commands BRPOP, BLPOP, and BRPOPLPUSH.  If these commands\nare used on the same redisClient instance as non-blocking commands, the\nnon-blocking ones may be queued up until after the blocking ones finish.\n\n    var Redis=require('redis');\n    var client = Redis.createClient();\n    var clientBlocking = client.duplicate();\n\n    var get = function() {\n        console.log(\"get called\");\n        client.get(\"any_key\",function() { console.log(\"get returned\"); });\n        setTimeout( get, 1000 );\n    };\n    var brpop = function() {\n        console.log(\"brpop called\");\n        clientBlocking.brpop(\"nonexistent\", 5, function() {\n            console.log(\"brpop return\");\n            setTimeout( brpop, 1000 );\n        });\n    };\n    get();\n    brpop();\n\nAnother reason to use duplicate() is when multiple DBs on the same server are\naccessed via the redis SELECT command.  Each DB could use its own connection.\n\n## client.send_command(command_name[, [args][, callback]])\n\nAll Redis commands have been added to the `client` object. However, if new\ncommands are introduced before this library is updated or if you want to add\nindividual commands you can use `send_command()` to send arbitrary commands to\nRedis.\n\nAll commands are sent as multi-bulk commands. `args` can either be an Array of\narguments, or omitted / set to undefined.\n\n## client.add_command(command_name)\n\nCalling add_command will add a new command to the prototype. The exact command\nname will be used when calling using this new command. Using arbitrary arguments\nis possible as with any other command.\n\n## client.connected\n\nBoolean tracking the state of the connection to the Redis server.\n\n## client.command_queue_length\n\nThe number of commands that have been sent to the Redis server but not yet\nreplied to. You can use this to enforce some kind of maximum queue depth for\ncommands while connected.\n\n## client.offline_queue_length\n\nThe number of commands that have been queued up for a future connection. You can\nuse this to enforce some kind of maximum queue depth for pre-connection\ncommands.\n\n### Commands with Optional and Keyword arguments\n\nThis applies to anything that uses an optional `[WITHSCORES]` or `[LIMIT offset\ncount]` in the [redis.io/commands](http://redis.io/commands) documentation.\n\nExample:\n\n```js\nvar args = [ 'myzset', 1, 'one', 2, 'two', 3, 'three', 99, 'ninety-nine' ];\nclient.zadd(args, function (err, response) {\n    if (err) throw err;\n    console.log('added '+response+' items.');\n\n    // -Infinity and +Infinity also work\n    var args1 = [ 'myzset', '+inf', '-inf' ];\n    client.zrevrangebyscore(args1, function (err, response) {\n        if (err) throw err;\n        console.log('example1', response);\n        // write your code here\n    });\n\n    var max = 3, min = 1, offset = 1, count = 2;\n    var args2 = [ 'myzset', max, min, 'WITHSCORES', 'LIMIT', offset, count ];\n    client.zrevrangebyscore(args2, function (err, response) {\n        if (err) throw err;\n        console.log('example2', response);\n        // write your code here\n    });\n});\n```\n\n## Performance\n\nMuch effort has been spent to make `node_redis` as fast as possible for common\noperations.\n\n```\nLenovo T450s, i7-5600U and 12gb memory\nclients: 1, NodeJS: 6.2.0, Redis: 3.2.0, parser: javascript, connected by: tcp\n         PING,         1/1 avg/max:   0.02/  5.26 2501ms total,   46916 ops/sec\n         PING,  batch 50/1 avg/max:   0.06/  4.35 2501ms total,  755178 ops/sec\n   SET 4B str,         1/1 avg/max:   0.02/  4.75 2501ms total,   40856 ops/sec\n   SET 4B str,  batch 50/1 avg/max:   0.11/  1.51 2501ms total,  432727 ops/sec\n   SET 4B buf,         1/1 avg/max:   0.05/  2.76 2501ms total,   20659 ops/sec\n   SET 4B buf,  batch 50/1 avg/max:   0.25/  1.76 2501ms total,  194962 ops/sec\n   GET 4B str,         1/1 avg/max:   0.02/  1.55 2501ms total,   45156 ops/sec\n   GET 4B str,  batch 50/1 avg/max:   0.09/  3.15 2501ms total,  524110 ops/sec\n   GET 4B buf,         1/1 avg/max:   0.02/  3.07 2501ms total,   44563 ops/sec\n   GET 4B buf,  batch 50/1 avg/max:   0.10/  3.18 2501ms total,  473171 ops/sec\n SET 4KiB str,         1/1 avg/max:   0.03/  1.54 2501ms total,   32627 ops/sec\n SET 4KiB str,  batch 50/1 avg/max:   0.34/  1.89 2501ms total,  146861 ops/sec\n SET 4KiB buf,         1/1 avg/max:   0.05/  2.85 2501ms total,   20688 ops/sec\n SET 4KiB buf,  batch 50/1 avg/max:   0.36/  1.83 2501ms total,  138165 ops/sec\n GET 4KiB str,         1/1 avg/max:   0.02/  1.37 2501ms total,   39389 ops/sec\n GET 4KiB str,  batch 50/1 avg/max:   0.24/  1.81 2501ms total,  208157 ops/sec\n GET 4KiB buf,         1/1 avg/max:   0.02/  2.63 2501ms total,   39918 ops/sec\n GET 4KiB buf,  batch 50/1 avg/max:   0.31/  8.56 2501ms total,  161575 ops/sec\n         INCR,         1/1 avg/max:   0.02/  4.69 2501ms total,   45685 ops/sec\n         INCR,  batch 50/1 avg/max:   0.09/  3.06 2501ms total,  539964 ops/sec\n        LPUSH,         1/1 avg/max:   0.02/  3.04 2501ms total,   41253 ops/sec\n        LPUSH,  batch 50/1 avg/max:   0.12/  1.94 2501ms total,  425090 ops/sec\n    LRANGE 10,         1/1 avg/max:   0.02/  2.28 2501ms total,   39850 ops/sec\n    LRANGE 10,  batch 50/1 avg/max:   0.25/  1.85 2501ms total,  194302 ops/sec\n   LRANGE 100,         1/1 avg/max:   0.05/  2.93 2501ms total,   21026 ops/sec\n   LRANGE 100,  batch 50/1 avg/max:   1.52/  2.89 2501ms total,   32767 ops/sec\n SET 4MiB str,         1/1 avg/max:   5.16/ 15.55 2502ms total,     193 ops/sec\n SET 4MiB str,  batch 20/1 avg/max:  89.73/ 99.96 2513ms total,     223 ops/sec\n SET 4MiB buf,         1/1 avg/max:   2.23/  8.35 2501ms total,     446 ops/sec\n SET 4MiB buf,  batch 20/1 avg/max:  41.47/ 50.91 2530ms total,     482 ops/sec\n GET 4MiB str,         1/1 avg/max:   2.79/ 10.91 2502ms total,     358 ops/sec\n GET 4MiB str,  batch 20/1 avg/max: 101.61/118.11 2541ms total,     197 ops/sec\n GET 4MiB buf,         1/1 avg/max:   2.32/ 14.93 2502ms total,     430 ops/sec\n GET 4MiB buf,  batch 20/1 avg/max:  65.01/ 84.72 2536ms total,     308 ops/sec\n ```\n\n## Debugging\n\nTo get debug output run your `node_redis` application with `NODE_DEBUG=redis`.\n\nThis is also going to result in good stack traces opposed to useless ones\notherwise for any async operation.\nIf you only want to have good stack traces but not the debug output run your\napplication in development mode instead (`NODE_ENV=development`).\n\nGood stack traces are only activated in development and debug mode as this\nresults in a significant performance penalty.\n\n___Comparison___:\nUseless stack trace:\n```\nReplyError: ERR wrong number of arguments for 'set' command\n    at parseError (/home/ruben/repos/redis/node_modules/redis-parser/lib/parser.js:158:12)\n    at parseType (/home/ruben/repos/redis/node_modules/redis-parser/lib/parser.js:219:14)\n```\nGood stack trace:\n```\nReplyError: ERR wrong number of arguments for 'set' command\n    at new Command (/home/ruben/repos/redis/lib/command.js:9:902)\n    at RedisClient.set (/home/ruben/repos/redis/lib/commands.js:9:3238)\n    at Context.<anonymous> (/home/ruben/repos/redis/test/good_stacks.spec.js:20:20)\n    at callFnAsync (/home/ruben/repos/redis/node_modules/mocha/lib/runnable.js:349:8)\n    at Test.Runnable.run (/home/ruben/repos/redis/node_modules/mocha/lib/runnable.js:301:7)\n    at Runner.runTest (/home/ruben/repos/redis/node_modules/mocha/lib/runner.js:422:10)\n    at /home/ruben/repos/redis/node_modules/mocha/lib/runner.js:528:12\n    at next (/home/ruben/repos/redis/node_modules/mocha/lib/runner.js:342:14)\n    at /home/ruben/repos/redis/node_modules/mocha/lib/runner.js:352:7\n    at next (/home/ruben/repos/redis/node_modules/mocha/lib/runner.js:284:14)\n    at Immediate._onImmediate (/home/ruben/repos/redis/node_modules/mocha/lib/runner.js:320:5)\n    at processImmediate [as _immediateCallback] (timers.js:383:17)\n```\n\n## How to Contribute\n- Open a pull request or an issue about what you want to implement / change. We're glad for any help!\n - Please be aware that we'll only accept fully tested code.\n\n## Contributors\n\nThe original author of node_redis is [Matthew Ranney](https://github.com/mranney)\n\nThe current lead maintainer is [Ruben Bridgewater](https://github.com/BridgeAR)\n\nMany [others](https://github.com/NodeRedis/node_redis/graphs/contributors)\ncontributed to `node_redis` too. Thanks to all of them!\n\n## License\n\n[MIT](LICENSE)\n\n### Consolidation: It's time for celebration\n\nRight now there are two great redis clients around and both have some advantages\nabove each other. We speak about ioredis and node_redis. So after talking to\neach other about how we could improve in working together we (that is @luin and\n@BridgeAR) decided to work towards a single library on the long run. But step by\nstep.\n\nFirst of all, we want to split small parts of our libraries into others so that\nwe're both able to use the same code. Those libraries are going to be maintained\nunder the NodeRedis organization. This is going to reduce the maintenance\noverhead, allows others to use the very same code, if they need it and it's way\neasyer for others to contribute to both libraries.\n\nWe're very happy about this step towards working together as we both want to\ngive you the best redis experience possible.\n\nIf you want to join our cause by help maintaining something, please don't\nhesitate to contact either one of us.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/NodeRedis/node_redis.git"
+  },
+  "scripts": {
+    "benchmark": "node benchmarks/multi_bench.js",
+    "compare": "node benchmarks/diff_multi_bench_output.js beforeBench.txt afterBench.txt",
+    "coverage": "nyc report --reporter=html",
+    "coveralls": "nyc report --reporter=text-lcov | coveralls",
+    "lint": "eslint . --fix && npm run coverage",
+    "test": "nyc --cache mocha ./test/*.js ./test/commands/*.js --timeout=8000"
+  },
+  "version": "2.8.0"
+}
diff --git a/routes/users.js b/routes/users.js
index 84216b8..cf2db42 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -4,6 +4,10 @@ var status = require('../util/resTemplate')
 
 router.prefix('/users')
 
+
+/**
+ * 添加用户
+ */
 router.post('/addUser',async (ctx, next) => {
   try{
     var data = await userContoller.addUser(ctx, next);
@@ -12,6 +16,11 @@ router.post('/addUser',async (ctx, next) => {
     status.catchError(400,e.message);    
   } 
 })
+
+
+/**
+ * 用户登录
+ */
 router.post('/login',async(ctx, next)=>{
   try{
     var data = await userContoller.login(ctx, next);  
@@ -21,6 +30,18 @@ router.post('/login',async(ctx, next)=>{
   } 
 })
 
+router.get('/authLogin.html', async function(ctx, next){
+	let type =  ctx.request.query.type;
+	if(type == "GITHUB"){
+		await ctx.redirect(`https://github.com/login/oauth/authorize?client_id=${config.github.client_id}&state=${Date.now()}&redirect_uri=${config.host}${config.github.redirect_url}`);
+	}else{
+		await ctx.redirect(`https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=${config.qq.appId}&state=${Date.now()}&redirect_uri=${config.host}${h}`);
+	}
+});
+
+/**
+ *获取用户列表
+ */
 router.get('/getStu/:type',async(ctx, next)=>{
   try{
     var data = await userContoller.getStu(ctx, next);  
@@ -30,6 +51,9 @@ router.get('/getStu/:type',async(ctx, next)=>{
   } 
 })
 
+/**
+ * 修改用户信息
+ */
 router.put('/updateUserByUserId/:userId',async(ctx, next)=>{
   try{
     let updateBackData = await userContoller.updateUserByUserId(ctx, next);  
@@ -40,6 +64,9 @@ router.put('/updateUserByUserId/:userId',async(ctx, next)=>{
   } 
 })
 
+/**
+ * 重置密码
+ */
 router.put('/resetPasswordByUserId/:userId',async(ctx, next)=>{
   try{
     let updateBackData = await userContoller.resetPasswordByUserId(ctx, next);  
@@ -50,6 +77,10 @@ router.put('/resetPasswordByUserId/:userId',async(ctx, next)=>{
   } 
 })
 
+
+/**
+ * 删除用户
+ */
 router.delete('/delUserByUserId/:userId',async(ctx, next)=>{
   try{
     let delData = await userContoller.delUserByUserId(ctx, next); 
@@ -60,6 +91,20 @@ router.delete('/delUserByUserId/:userId',async(ctx, next)=>{
   } 
 })
 
+/**
+ * 根据手机号验证码修改密码
+ */
+router.put('/updatePwByTelphone',async(ctx, next)=>{
+  try{
+    let delData = await userContoller.updatePwByTelphone(ctx, next); 
+    status.successTemp(ctx,200,delData);
+  }catch(e){
+    console.log(e)
+    status.catchError(ctx,400,e.message);    
+  } 
+})
+
+
 
 
 
diff --git a/services/userService.js b/services/userService.js
index ea8d632..c0f1c92 100644
--- a/services/userService.js
+++ b/services/userService.js
@@ -13,7 +13,12 @@ function userService(){
 userService.prototype.addUser = async(data)=>{
 
 try{
-   let oldUser = await userModel.find({where:{loginName:data.loginName}}) 
+    var queryData = [
+            {userMobile:data.userMobile},
+            {loginName:data.loginName },
+            {userEmail:data.userEmail }
+        ]
+   let oldUser = await userModel.find({where:{$or:queryData}}) 
    if(oldUser){
        return {code:400,msg:'用户已存在'}
    }
@@ -24,9 +29,15 @@ try{
 }
 }
 
-userService.prototype.login = async(name,pw) => {
+userService.prototype.login = async(loginName,pw,userEmail) => {
     try{
-        let User = await userModel.find({where:{loginName:name}}) 
+        let query;
+        if(!loginName){
+            query = {userEmail:userEmail};
+        }else if(!userEmail){
+            query = {loginName:loginName};
+        }
+        let User = await userModel.find({where:query}) 
         console.dir(User)
         if(!User){
             return {code:300,msg:'用户不存在'}
@@ -75,6 +86,23 @@ userService.prototype.resetPasswordByUserId = async(userId,pw) => {
      }
 }
 
+userService.prototype.updatePwByTelphone = async(tel,pw) => {
+    try{
+        var t = await sequelize.transaction({  autocommit: true })        
+        let User = await userModel.findOne({where:{userMobile:tel}}) 
+        if(!User){
+            t.rollback
+            return {code:0,msg:'用户不存在'}
+        }
+        let updateUser = await userModel.update({password:pw.md5Pass,salt:pw.salt},{where:{userMobile:tel}}); 
+        t.commit();       
+        return updateUser
+     }catch (err){
+         t.rollback();
+         throw new Error(err);         
+     }
+}
+
 userService.prototype.updateUserByUserId = async(userId,data)=>{
     try {
         var t = await sequelize.transaction({  autocommit: true })
diff --git a/util/SendSms.js b/util/SendSms.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/util/SendSms.js
diff --git a/util/redis.js b/util/redis.js
new file mode 100644
index 0000000..c98a6d1
--- /dev/null
+++ b/util/redis.js
@@ -0,0 +1,25 @@
+const redis   = require('redis');
+const client  = redis.createClient(6379, '127.0.0.1');
+
+function createRedis (){
+    
+}
+
+createRedis.prototype.setToken =  async(id, token) => {
+    let ok =  await client.set(id, token); 
+    return ok;   
+};
+
+createRedis.prototype.getToken =  async(id) => {
+    return new Promise((resolve, reject) =>{
+        client.get(id,function(err,data){
+            if(err){
+                reject(err)
+                }
+                resolve(data)
+        });
+    })
+  };
+
+
+  module.exports = new createRedis();
\ No newline at end of file
--
libgit2 0.24.0