Skip to content

Commit df90de2

Browse files
authored
docs: advocate import { Redis } from 'ioredis' (#1703)
1 parent ef2d2cd commit df90de2

File tree

5 files changed

+29
-39
lines changed

5 files changed

+29
-39
lines changed

README.md

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ ioredis is a robust, full-featured Redis client that is
1616
used in the world's biggest online commerce company [Alibaba](http://www.alibaba.com/) and many other awesome companies.
1717

1818
0. Full-featured. It supports [Cluster](http://redis.io/topics/cluster-tutorial), [Sentinel](https://redis.io/docs/reference/sentinel-clients), [Streams](https://redis.io/topics/streams-intro), [Pipelining](http://redis.io/topics/pipelining), and of course [Lua scripting](http://redis.io/commands/eval), [Redis Functions](https://redis.io/topics/functions-intro), [Pub/Sub](http://redis.io/topics/pubsub) (with the support of binary messages).
19-
0. High performance 🚀.
20-
0. Delightful API 😄. It works with Node callbacks and Native promises.
21-
0. Transformation of command arguments and replies.
22-
0. Transparent key prefixing.
23-
0. Abstraction for Lua scripting, allowing you to [define custom commands](https://github.com/luin/ioredis#lua-scripting).
24-
0. Supports [binary data](https://github.com/luin/ioredis#handle-binary-data).
25-
0. Supports [TLS](https://github.com/luin/ioredis#tls-options) 🔒.
26-
0. Supports offline queue and ready checking.
27-
0. Supports ES6 types, such as `Map` and `Set`.
28-
0. Supports GEO commands 📍.
29-
0. Supports Redis ACL.
30-
0. Sophisticated error handling strategy.
31-
0. Supports NAT mapping.
32-
0. Supports autopipelining.
19+
1. High performance 🚀.
20+
2. Delightful API 😄. It works with Node callbacks and Native promises.
21+
3. Transformation of command arguments and replies.
22+
4. Transparent key prefixing.
23+
5. Abstraction for Lua scripting, allowing you to [define custom commands](https://github.com/luin/ioredis#lua-scripting).
24+
6. Supports [binary data](https://github.com/luin/ioredis#handle-binary-data).
25+
7. Supports [TLS](https://github.com/luin/ioredis#tls-options) 🔒.
26+
8. Supports offline queue and ready checking.
27+
9. Supports ES6 types, such as `Map` and `Set`.
28+
10. Supports GEO commands 📍.
29+
11. Supports Redis ACL.
30+
12. Sophisticated error handling strategy.
31+
13. Supports NAT mapping.
32+
14. Supports autopipelining.
3333

3434
**100% written in TypeScript and official declarations are provided:**
3535

@@ -66,16 +66,6 @@ Upstash is a Serverless Database with Redis/REST API and durable storage. It is
6666

6767
<br clear="both"/>
6868

69-
### Redis Cloud: From the creators of Redis
70-
71-
<a href="https://redis.info/ioredis-tryfree"><img align="right" width="320" src="resources/redis-tryfree.png" alt="redis-tryfree"></a>
72-
73-
Experience the best Redis. For a limited time, sign up to Redis Enterprise Cloud and use **MATRIX200** to get $200 credits, and a chance to win a Tesla!
74-
75-
[Sign Up Now!](https://redis.info/ioredis-tryfree)
76-
77-
<br clear="both"/>
78-
7969
### Medis: Redis GUI for macOS
8070

8171
<a href="https://getmedis.com/"><img align="right" width="404" src="resources/medis.png" alt="Download on the App Store"></a>
@@ -115,10 +105,10 @@ npm install --save-dev @types/node
115105

116106
```javascript
117107
// Import ioredis.
118-
// You can also use `import Redis from "ioredis"`
108+
// You can also use `import { Redis } from "ioredis"`
119109
// if your project is a TypeScript project,
120-
// or `import { default as Redis } from "ioredis"`
121-
// if it is an ESM module.
110+
// Note that `import Redis from "ioredis"` is still supported,
111+
// but will be deprecated in the next major version.
122112
const Redis = require("ioredis");
123113

124114
// Create a Redis instance.
@@ -157,14 +147,14 @@ redis.set("mykey", "hello", "EX", 10);
157147

158148
See the `examples/` folder for more examples. For example:
159149

160-
* [TTL](examples/ttl.js)
161-
* [Strings](examples/string.js)
162-
* [Hashes](examples/hash.js)
163-
* [Lists](examples/list.js)
164-
* [Sets](examples/set.js)
165-
* [Sorted Sets](examples/zset.js)
166-
* [Streams](examples/stream.js)
167-
* [Redis Modules](examples/module.js) e.g. RedisJSON
150+
- [TTL](examples/ttl.js)
151+
- [Strings](examples/string.js)
152+
- [Hashes](examples/hash.js)
153+
- [Lists](examples/list.js)
154+
- [Sets](examples/set.js)
155+
- [Sorted Sets](examples/zset.js)
156+
- [Streams](examples/stream.js)
157+
- [Redis Modules](examples/module.js) e.g. RedisJSON
168158

169159
All Redis commands are supported. See [the documentation](https://luin.github.io/ioredis/classes/Redis.html) for details.
170160

test/typing/commands.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expectError, expectType } from "tsd";
2-
import Redis from "../../built";
2+
import { Redis } from "../../built";
33

44
const redis = new Redis();
55

test/typing/options.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expectAssignable, expectType } from "tsd";
2-
import Redis, { Cluster, NatMap, DNSLookupFunction } from "../../built";
2+
import { Redis, Cluster, NatMap, DNSLookupFunction } from "../../built";
33

44
expectType<Redis>(new Redis());
55

test/typing/pipeline.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expectType } from "tsd";
2-
import Redis, { Pipeline } from "../../built";
2+
import { Redis, Pipeline } from "../../built";
33

44
const redis = new Redis();
55

test/typing/transformers.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expectType } from "tsd";
2-
import Redis from "../../built";
2+
import { Redis } from "../../built";
33

44
interface User {
55
name: string;

0 commit comments

Comments
 (0)