Skip to content

Commit 0fea059

Browse files
author
Ruben Bridgewater
committed
Improve readme / fix travis
Install hiredis on travis Add batch and fix typos
1 parent 3b7061c commit 0fea059

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

.travis

Lines changed: 0 additions & 7 deletions
This file was deleted.

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: node_js
2+
sudo: false
3+
env:
4+
- CXX=g++-4.8
5+
addons:
6+
apt:
7+
sources:
8+
- ubuntu-toolchain-r-test
9+
packages:
10+
- g++-4.8
11+
node_js:
12+
- "0.10"
13+
- "0.12"
14+
- "4.0"
15+
- "5.0"
16+
install:
17+
- npm install
18+
- npm install hiredis
19+
after_success:
20+
- CODECLIMATE_REPO_TOKEN=c60100f656e32c1003fec9b96c4aba47fd4c190069931763ac1879aa2ef28398 node ./node_modules/.bin/codeclimate-test-reporter < coverage/lcov.info

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
[![Build Status](https://travis-ci.org/NodeRedis/redis-parser.png?branch=master)](https://travis-ci.org/NodeRedis/redis-parser)
1+
[![Build Status](https://travis-ci.org/NodeRedis/node-redis-parser.png?branch=master)](https://travis-ci.org/NodeRedis/node-redis-parser)
2+
[![Code Climate](https://codeclimate.com/github/NodeRedis/node-redis-parser/badges/gpa.svg)](https://codeclimate.com/github/NodeRedis/node-redis-parser)
3+
[![Test Coverage](https://codeclimate.com/github/NodeRedis/node-redis-parser/badges/coverage.svg)](https://codeclimate.com/github/NodeRedis/node-redis-parser/coverage)
24

35
# redis-parser
46

57
A high performance redis parser solution built for [node_redis](https://github.com/NodeRedis/node_redis) and [ioredis](https://github.com/ioredis/luin).
68

9+
Generally all [RESP](http://redis.io/topics/protocol) data will be properly parsed by the parser.
10+
711
## Install
812

913
Install with [NPM](https://npmjs.org/):
@@ -20,12 +24,12 @@ new Parser(options);
2024

2125
### Possible options
2226

23-
`returnReply`: *function*; mandatory
24-
`returnError`: *function*; mandatory
25-
`returnFatalError`: *function*; optional, defaults to the returnError function
26-
`returnBuffers`: *boolean*; optional, defaults to false
27-
`name`: *javascript|hiredis*; optional, defaults to hiredis and falls back to the js parser if not available
28-
`context`: *A class instance that the return functions get bound to*; optional
27+
* `returnReply`: *function*; mandatory
28+
* `returnError`: *function*; mandatory
29+
* `returnFatalError`: *function*; optional, defaults to the returnError function
30+
* `returnBuffers`: *boolean*; optional, defaults to false
31+
* `name`: *javascript|hiredis*; optional, defaults to hiredis and falls back to the js parser if not available
32+
* `context`: *A class instance that the return functions get bound to*; optional
2933

3034
### Example
3135

@@ -50,7 +54,6 @@ var parser = new Parser({
5054
Library.prototype.streamHandler = function () {
5155
this.stream.on('data', function (buffer) {
5256
// 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.
53-
// All [RESP](http://redis.io/topics/protocol) data will be properly parsed by the parser.
5457
parser.execute(buffer);
5558
});
5659
};
@@ -101,4 +104,4 @@ node benchmarks/diff_multi_bench_output.js old.log new.log > improvement.log
101104

102105
## License
103106

104-
[MIT](./LICENSE
107+
[MIT](./LICENSE)

lib/javascript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ JavascriptReplyParser.prototype.tryParsing = function () {
123123
}
124124
};
125125

126-
JavascriptReplyParser.prototype.run = function (buffer) {
126+
JavascriptReplyParser.prototype.run = function () {
127127
// Set a rewind point. If a failure occurs, wait for the next execute()/append() and try again
128128
this.offsetCache = this.offset;
129129
this.type = this.buffer[this.offset++];

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"devDependencies": {
3131
"jshint": "^2.8.0",
3232
"mocha": "^2.3.2",
33-
"istanbul": "^0.4.0"
33+
"istanbul": "^0.4.0",
34+
"codeclimate-test-reporter": "^0.1.1"
3435
},
3536
"optionalDependency": {
3637
"hiredis": "^0.4.1"

0 commit comments

Comments
 (0)