Comparing version 5.0.5 to 5.0.6
@@ -29,1 +29,4 @@ import Redis from "./Redis"; | ||
export default Pipeline; | ||
interface Pipeline { | ||
length: number; | ||
} |
{ | ||
"name": "ioredis", | ||
"version": "5.0.5", | ||
"version": "5.0.6", | ||
"description": "A robust, performance-focused and full-featured Redis client for Node.js.", | ||
@@ -5,0 +5,0 @@ "main": "./built/index.js", |
@@ -105,3 +105,3 @@ [![ioredis](https://cdn.jsdelivr.net/gh/luin/ioredis@b5e8c74/logo.svg)](https://github.com/luin/ioredis) | ||
```shell | ||
$ npm install ioredis | ||
npm install ioredis | ||
``` | ||
@@ -112,3 +112,3 @@ | ||
```shell | ||
$ npm install --save-dev @types/node | ||
npm install --save-dev @types/node | ||
``` | ||
@@ -317,17 +317,25 @@ | ||
Arguments can be buffers: | ||
Binary data support is out of the box. Pass buffers to send binary data: | ||
```javascript | ||
redis.set("foo", Buffer.from("bar")); | ||
redis.set("foo", Buffer.from([0x62, 0x75, 0x66])); | ||
``` | ||
And every command has a method that returns a Buffer (by adding a suffix of "Buffer" to the command name). | ||
To get a buffer instead of a utf8 string: | ||
Every command that returns a [bulk string](https://redis.io/docs/reference/protocol-spec/#resp-bulk-strings) | ||
has a variant command with a `Buffer` suffix. The variant command returns a buffer instead of a UTF-8 string: | ||
```javascript | ||
redis.getBuffer("foo", (err, result) => { | ||
// result is a buffer. | ||
}); | ||
const result = await redis.getBuffer("foo"); | ||
// result is `<Buffer 62 75 66>` | ||
``` | ||
It's worth noticing that you don't need the `Buffer` suffix variant in order to **send** binary data. That means | ||
in most case you should just use `redis.set()` instead of `redis.setBuffer()` unless you want to get the old value | ||
with the `GET` parameter: | ||
```javascript | ||
const result = await redis.setBuffer("foo", "new value", "GET"); | ||
// result is `<Buffer 62 75 66>` as `GET` indicates returning the old value. | ||
``` | ||
## Pipelining | ||
@@ -1394,3 +1402,3 @@ | ||
```shell | ||
$ npm test | ||
npm test | ||
``` | ||
@@ -1397,0 +1405,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
674751
14825
1439