@keyv/redis 5.1.6 → 6.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -18
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -419,34 +419,42 @@ You can learn more about the `createCluster` function in the [documentation](htt
|
|
|
419
419
|
|
|
420
420
|
# Sentinel
|
|
421
421
|
|
|
422
|
-
If you are using Sentinel to provide high availability for your Redis instances, you can pass in the
|
|
422
|
+
If you are using Sentinel to provide high availability for your Redis instances, you can pass in the sentinel options directly to the `KeyvRedis` constructor:
|
|
423
423
|
|
|
424
424
|
```js
|
|
425
425
|
import Keyv from 'keyv';
|
|
426
|
-
import KeyvRedis
|
|
426
|
+
import KeyvRedis from '@keyv/redis';
|
|
427
427
|
|
|
428
|
-
const
|
|
429
|
-
|
|
428
|
+
const keyv = new Keyv({
|
|
429
|
+
store: new KeyvRedis({
|
|
430
|
+
name: 'mymaster',
|
|
430
431
|
sentinelRootNodes: [
|
|
431
|
-
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
host: '127.0.0.1',
|
|
437
|
-
port: 26380,
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
host: '127.0.0.1',
|
|
441
|
-
port: 26381,
|
|
442
|
-
},
|
|
432
|
+
{ host: '127.0.0.1', port: 26379 },
|
|
433
|
+
{ host: '127.0.0.1', port: 26380 },
|
|
434
|
+
{ host: '127.0.0.1', port: 26381 },
|
|
443
435
|
],
|
|
436
|
+
}),
|
|
444
437
|
});
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
For TypeScript users, the `RedisSentinelOptions` type is exported from the package:
|
|
441
|
+
|
|
442
|
+
```typescript
|
|
443
|
+
import KeyvRedis, { type RedisSentinelOptions } from '@keyv/redis';
|
|
444
|
+
|
|
445
|
+
const sentinelOptions: RedisSentinelOptions = {
|
|
446
|
+
name: 'mymaster',
|
|
447
|
+
sentinelRootNodes: [
|
|
448
|
+
{ host: '127.0.0.1', port: 26379 },
|
|
449
|
+
{ host: '127.0.0.1', port: 26380 },
|
|
450
|
+
{ host: '127.0.0.1', port: 26381 },
|
|
451
|
+
],
|
|
452
|
+
};
|
|
445
453
|
|
|
446
|
-
const
|
|
454
|
+
const keyvRedis = new KeyvRedis(sentinelOptions);
|
|
447
455
|
```
|
|
448
456
|
|
|
449
|
-
You can learn more about
|
|
457
|
+
You can learn more about Sentinel configuration in the [documentation](https://github.com/redis/node-redis/blob/master/docs/sentinel.md) at https://github.com/redis/node-redis/tree/master/docs.
|
|
450
458
|
|
|
451
459
|
# TLS Support
|
|
452
460
|
|
package/dist/index.cjs
CHANGED
|
@@ -122,7 +122,7 @@ var KeyvRedis = class extends import_hookified.Hookified {
|
|
|
122
122
|
* @param {KeyvRedisOptions} [options] Options for the adapter such as namespace, keyPrefixSeparator, and clearBatchSize.
|
|
123
123
|
*/
|
|
124
124
|
constructor(connect, options) {
|
|
125
|
-
super();
|
|
125
|
+
super({ throwOnEmptyListeners: false });
|
|
126
126
|
const socket = {
|
|
127
127
|
reconnectStrategy: defaultReconnectStrategy
|
|
128
128
|
// Default timeout for the connection
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RedisClientType, RedisModules, RedisFunctions, RedisScripts, RespVersions, TypeMapping, RedisClusterType, RedisSentinelType, RedisClientOptions, RedisClusterOptions, RedisSentinelOptions } from '@redis/client';
|
|
2
|
-
export { RedisClientOptions, RedisClientType, RedisClusterOptions, RedisClusterType, RedisSentinelType, createClient, createCluster, createSentinel } from '@redis/client';
|
|
2
|
+
export { RedisClientOptions, RedisClientType, RedisClusterOptions, RedisClusterType, RedisSentinelOptions, RedisSentinelType, createClient, createCluster, createSentinel } from '@redis/client';
|
|
3
3
|
import { Hookified } from 'hookified';
|
|
4
4
|
import { Keyv, KeyvStoreAdapter, KeyvEntry } from 'keyv';
|
|
5
5
|
export { Keyv } from 'keyv';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RedisClientType, RedisModules, RedisFunctions, RedisScripts, RespVersions, TypeMapping, RedisClusterType, RedisSentinelType, RedisClientOptions, RedisClusterOptions, RedisSentinelOptions } from '@redis/client';
|
|
2
|
-
export { RedisClientOptions, RedisClientType, RedisClusterOptions, RedisClusterType, RedisSentinelType, createClient, createCluster, createSentinel } from '@redis/client';
|
|
2
|
+
export { RedisClientOptions, RedisClientType, RedisClusterOptions, RedisClusterType, RedisSentinelOptions, RedisSentinelType, createClient, createCluster, createSentinel } from '@redis/client';
|
|
3
3
|
import { Hookified } from 'hookified';
|
|
4
4
|
import { Keyv, KeyvStoreAdapter, KeyvEntry } from 'keyv';
|
|
5
5
|
export { Keyv } from 'keyv';
|
package/dist/index.js
CHANGED
|
@@ -88,7 +88,7 @@ var KeyvRedis = class extends Hookified {
|
|
|
88
88
|
* @param {KeyvRedisOptions} [options] Options for the adapter such as namespace, keyPrefixSeparator, and clearBatchSize.
|
|
89
89
|
*/
|
|
90
90
|
constructor(connect, options) {
|
|
91
|
-
super();
|
|
91
|
+
super({ throwOnEmptyListeners: false });
|
|
92
92
|
const socket = {
|
|
93
93
|
reconnectStrategy: defaultReconnectStrategy
|
|
94
94
|
// Default timeout for the connection
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keyv/redis",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-alpha.2",
|
|
4
4
|
"description": "Redis storage adapter for Keyv",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@redis/client": "^5.10.0",
|
|
44
44
|
"cluster-key-slot": "^1.1.2",
|
|
45
|
-
"hookified": "^
|
|
45
|
+
"hookified": "^2.0.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"keyv": "^
|
|
48
|
+
"keyv": "^6.0.0-alpha.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@biomejs/biome": "^2.3.11",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"timekeeper": "^2.3.1",
|
|
56
56
|
"tsd": "^0.33.0",
|
|
57
57
|
"vitest": "^4.0.16",
|
|
58
|
-
"@keyv/test-suite": "^
|
|
58
|
+
"@keyv/test-suite": "^6.0.0-alpha.2"
|
|
59
59
|
},
|
|
60
60
|
"tsd": {
|
|
61
61
|
"directory": "test"
|