You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
update readmes, add createCluster to the redis
package
This commit is contained in:
14
index.ts
14
index.ts
@@ -1,9 +1,12 @@
|
||||
import { createClient as _createClient } from '@redis/client';
|
||||
import { createClient as _createClient, createCluster as _createCluster } from '@redis/client';
|
||||
import { RedisScripts } from '@redis/client/dist/lib/commands';
|
||||
import { RedisClientOptions, RedisClientType } from '@redis/client/dist/lib/client';
|
||||
import { RedisClusterOptions, RedisClusterType } from '@redis/client/dist/lib/cluster';
|
||||
import RedisJSON from '@redis/json';
|
||||
import RediSearch from '@redis/search';
|
||||
|
||||
export * from '@redis/client';
|
||||
export * from '@redis/json';
|
||||
export * from '@redis/search';
|
||||
|
||||
const modules = {
|
||||
@@ -19,3 +22,12 @@ export function createClient<S extends RedisScripts = Record<string, never>>(
|
||||
modules
|
||||
});
|
||||
}
|
||||
|
||||
export function createCluster<S extends RedisScripts = Record<string, never>>(
|
||||
options: Omit<RedisClusterOptions<never, S>, 'modules'>
|
||||
): RedisClusterType<typeof modules, S> {
|
||||
return _createCluster({
|
||||
...options,
|
||||
modules
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user