Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: redis/ioredis
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.5
Choose a base ref
...
head repository: redis/ioredis
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.0.6
Choose a head ref
  • 4 commits
  • 17 files changed
  • 3 contributors

Commits on May 21, 2022

  1. docs: clarify suffix use cases

    Related to #1586
    luin committed May 21, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    kwasniew Mateusz Kwasniewski
    Copy the full SHA
    fb8630f View commit details

Commits on May 27, 2022

  1. Verified

    This commit was signed with the committer’s verified signature.
    kwasniew Mateusz Kwasniewski
    Copy the full SHA
    fe21620 View commit details

Commits on May 31, 2022

  1. fix: Add back Pipeline#length (#1585)

    Closes #1584
    luin authored May 31, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    63b2ee4 View commit details
  2. chore(release): 5.0.6 [skip ci]

    ## [5.0.6](v5.0.5...v5.0.6) (2022-05-31)
    
    ### Bug Fixes
    
    * Add back Pipeline#length ([#1585](#1585)) ([63b2ee4](63b2ee4)), closes [#1584](#1584)
    ioredis-robot authored and semantic-release-bot committed May 31, 2022
    Copy the full SHA
    550fe1f View commit details
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [5.0.6](https://github.com/luin/ioredis/compare/v5.0.5...v5.0.6) (2022-05-31)


### Bug Fixes

* Add back Pipeline#length ([#1585](https://github.com/luin/ioredis/issues/1585)) ([63b2ee4](https://github.com/luin/ioredis/commit/63b2ee49c52c8cee326d30f62bc29c64f3ec28b3)), closes [#1584](https://github.com/luin/ioredis/issues/1584)

## [5.0.5](https://github.com/luin/ioredis/compare/v5.0.4...v5.0.5) (2022-05-17)


28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -102,13 +102,13 @@ Medis starts with all the basic features you need:
## Install

```shell
$ npm install ioredis
npm install ioredis
```

In a TypeScript project, you may want to add TypeScript declarations for Node.js:

```shell
$ npm install --save-dev @types/node
npm install --save-dev @types/node
```

## Basic Usage
@@ -312,19 +312,27 @@ listenForMessage();

## Handle Binary Data

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
@@ -1388,7 +1396,7 @@ default, this option is disabled and can only be used for debugging purposes. Yo
Start a Redis server on 127.0.0.1:6379, and then:

```shell
$ npm test
npm test
```

`FLUSH ALL` will be invoked after each test, so make sure there's no valuable data in it before running tests.
5 changes: 3 additions & 2 deletions bin/template.ts
Original file line number Diff line number Diff line change
@@ -11,8 +11,9 @@ export interface ResultTypes<Result, Context> {
pipeline: ChainableCommander;
}

export interface ChainableCommander
extends RedisCommander<{ type: "pipeline" }> {}
export interface ChainableCommander extends RedisCommander<{ type: "pipeline" }> {
length: number;
}

export type ClientContext = { type: keyof ResultTypes<unknown, unknown> };
export type Result<T, Context extends ClientContext> =
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

Loading