Skip to content

Commit d12bc97

Browse files
author
Ruben Bridgewater
committed
Move hiredis back into the lib folder to keep it deprecated
1 parent d3c5cf6 commit d12bc97

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

changelog.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
## v.2.0.0 - 0x May, 2016
22

33
The javascript parser got completly 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.
4-
Therefore the hiredis parser was removed and is only used for testing purposes and benchmarking comparison.
4+
Therefore the hiredis parser was deprecated and should only be used for testing purposes and benchmarking comparison.
55

66
All Errors returned by the parser are from now on of class ReplyError
77

88
Features
99

10+
- Improved performance by up to 15x as fast as before
11+
- Improved options validation
1012
- Added ReplyError Class
1113
- Added parser benchmark
14+
- Switched default parser from hiredis to JS, no matter if hiredis is installed or not
1215

1316
Removed
1417

15-
- Dropped support of hiredis
16-
- The `name` option is "removed"
17-
- It is still available for backwards compatibility but it is strongly recommended not to use it
18+
- Deprecated hiredis support
1819

1920
## v.1.3.0 - 27 Mar, 2016
2021

test/hiredis.js renamed to lib/hiredis.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ function parseData (parser) {
2525
* @constructor
2626
*/
2727
function HiredisReplyParser (options) {
28-
if (!(this instanceof HiredisReplyParser)) {
29-
return new HiredisReplyParser(options)
30-
}
3128
this.returnError = options.returnError
3229
this.returnFatalError = options.returnFatalError || options.returnError
3330
this.returnReply = options.returnReply

lib/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function JavascriptRedisParser (options) {
254254
if (options.name === 'hiredis') {
255255
/* istanbul ignore next: hiredis is only supported for legacy usage */
256256
try {
257-
var Hiredis = require('../test/hiredis')
257+
var Hiredis = require('./hiredis')
258258
console.error(new TypeError('Using hiredis is discouraged. Please use the faster JS parser by removing the name option.').stack.replace('Error', 'Warning'))
259259
return new Hiredis(options)
260260
} catch (e) {

test/parsers.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
var assert = require('assert')
66
var JavascriptParser = require('../')
7-
var HiredisParser = require('./hiredis')
7+
var HiredisParser = require('../lib/hiredis')
88
var ReplyError = JavascriptParser.ReplyError
99
var parsers = [JavascriptParser, HiredisParser]
1010

0 commit comments

Comments
 (0)