Skip to content

Commit 05f9f0e

Browse files
committed
WIP
1 parent eb47bb0 commit 05f9f0e

31 files changed

+390
-386
lines changed

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,5 @@ await client.connect();
9090

9191
// Add your example code here...
9292

93-
await client.quit();
93+
client.destroy();
9494
```

examples/blocking-list-pop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ console.log('blpopPromise resolved');
2727
// {"key":"keyName","element":"value"}
2828
console.log(`listItem is '${JSON.stringify(listItem)}'`);
2929

30-
await client.quit();
30+
client.destroy();

examples/bloom-filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ const info = await client.bf.info('mybloom');
7777
// }
7878
console.log(info);
7979

80-
await client.quit();
80+
client.destroy();

examples/check-connection-status.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ console.log('Afer connectPromise has resolved...');
2525
// isReady will return True here, client is ready to use.
2626
console.log(`client.isOpen: ${client.isOpen}, client.isReady: ${client.isReady}`);
2727

28-
await client.quit();
28+
client.destroy();

examples/command-with-modifiers.js

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
// Define a custom script that shows example of SET command
22
// with several modifiers.
33

4-
import { createClient } from 'redis';
4+
import { createClient } from '../packages/client';
55

66
const client = createClient();
77

88
await client.connect();
99
await client.del('mykey');
1010

11-
let result = await client.set('mykey', 'myvalue', {
12-
EX: 60,
13-
GET: true
14-
});
15-
16-
console.log(result); //null
17-
18-
result = await client.set('mykey', 'newvalue', {
19-
EX: 60,
20-
GET: true
21-
});
22-
23-
console.log(result); //myvalue
24-
25-
await client.quit();
11+
console.log(
12+
await client.set('mykey', 'myvalue', {
13+
expiration: {
14+
type: 'EX',
15+
value: 60
16+
},
17+
GET: true
18+
})
19+
); // null
20+
21+
console.log(
22+
await client.set('mykey', 'newvalue', {
23+
expiration: {
24+
type: 'EX',
25+
value: 60
26+
},
27+
GET: true
28+
})
29+
); // 'myvalue'
30+
31+
await client.close();

examples/connect-as-acl-user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ try {
2323
console.log(`GET command failed: ${e.message}`);
2424
}
2525

26-
await client.quit();
26+
client.destroy();

examples/count-min-sketch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ console.log('Count-Min Sketch info:');
7777
// }
7878
console.log(info);
7979

80-
await client.quit();
80+
client.destroy();

examples/cuckoo-filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ const info = await client.cf.info('mycuckoo');
7676
// }
7777
console.log(info);
7878

79-
await client.quit();
79+
client.destroy();

examples/get-server-time.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ const serverTime = await client.time();
99
// 2022-02-25T12:57:40.000Z { microseconds: 351346 }
1010
console.log(serverTime);
1111

12-
await client.quit();
12+
client.destroy();

examples/hyperloglog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ try {
4848
console.error(e);
4949
}
5050

51-
await client.quit();
51+
client.destroy();

0 commit comments

Comments
 (0)