Skip to content

Commit 9151ae0

Browse files
SalakarRuben Bridgewater
authored andcommitted
Update README.md
1 parent decf592 commit 9151ae0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
A high performance javascript redis parser built for [node_redis](https://github.com/NodeRedis/node_redis) and [ioredis](https://github.com/luin/ioredis).
99

10-
Generally all [RESP](http://redis.io/topics/protocol) data will be properly parsed by the parser.
10+
All [RESP](http://redis.io/topics/protocol) data is parsed by this parser.
1111

1212
## Install
1313

@@ -22,7 +22,7 @@ npm install redis-parser
2222
```js
2323
var Parser = require('redis-parser');
2424

25-
new Parser(options);
25+
var myParser = new Parser(options);
2626
```
2727

2828
### Possible options
@@ -31,7 +31,6 @@ new Parser(options);
3131
* `returnError`: *function*; mandatory
3232
* `returnFatalError`: *function*; optional, defaults to the returnError function
3333
* `returnBuffers`: *boolean*; optional, defaults to false
34-
* `stringNumbers`: *boolean*; optional, defaults to false
3534

3635
### Example
3736

@@ -69,7 +68,7 @@ You do not have to use the returnFatalError function. Fatal errors will be retur
6968

7069
And if you want to return buffers instead of strings, you can do this by adding the `returnBuffers` option.
7170

72-
If you handle big numbers, you should pass the `stringNumbers` option. That case numbers above 2^53 can be handled properly without reduced precision.
71+
Big numbers that are too large for JS are automatically stringified.
7372

7473
```js
7574
// Same functions as in the first example
@@ -81,7 +80,6 @@ var parser = new Parser({
8180
returnError: function(err) {
8281
lib.returnError(err);
8382
},
84-
stringNumbers: true, // Return all numbers as string instead of a js number
8583
returnBuffers: true // All strings are returned as buffer e.g. <Buffer 48 65 6c 6c 6f>
8684
});
8785

@@ -90,12 +88,11 @@ var parser = new Parser({
9088

9189
## Protocol errors
9290

93-
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. Be aware that while doing this, no new command may be added, so all new commands have to be buffered in the meanwhile.
94-
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.
91+
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.
9592

9693
## Contribute
9794

98-
The parser is already optimized but there are likely further optimizations possible.
95+
The parser is highly optimized but there may still be further optimizations possible.
9996

10097
```
10198
npm install

0 commit comments

Comments
 (0)