You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Export CommandParser from client index file and fix doc (#2945)
* Export CommandParser from client index file * Tidy up long export line in client index file Wrap and sort entries. * Adapt and fix wrong examples in programmability doc
This commit is contained in:
@@ -25,9 +25,8 @@ FUNCTION LOAD "#!lua name=library\nredis.register_function{function_name='add',
|
|||||||
Load the prior redis function on the _redis server_ before running the example below.
|
Load the prior redis function on the _redis server_ before running the example below.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { CommandParser } from '@redis/client/lib/client/parser';
|
import { CommandParser, createClient, RedisArgument } from '@redis/client';
|
||||||
import { NumberReply } from '@redis/client/lib/RESP/types';
|
import { NumberReply } from '@redis/client/dist/lib/RESP/types.js';
|
||||||
import { createClient, RedisArgument } from 'redis';
|
|
||||||
|
|
||||||
const client = createClient({
|
const client = createClient({
|
||||||
functions: {
|
functions: {
|
||||||
@@ -58,9 +57,8 @@ await client.library.add('key', '2'); // 3
|
|||||||
The following is an end-to-end example of the prior concept.
|
The following is an end-to-end example of the prior concept.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { CommandParser } from '@redis/client/lib/client/parser';
|
import { CommandParser, createClient, defineScript, RedisArgument } from '@redis/client';
|
||||||
import { NumberReply } from '@redis/client/lib/RESP/types';
|
import { NumberReply } from '@redis/client/dist/lib/RESP/types.js';
|
||||||
import { createClient, defineScript, RedisArgument } from 'redis';
|
|
||||||
|
|
||||||
const client = createClient({
|
const client = createClient({
|
||||||
scripts: {
|
scripts: {
|
||||||
|
@@ -1,4 +1,12 @@
|
|||||||
export { RedisModules, RedisFunctions, RedisScripts, RespVersions, TypeMapping/*, CommandPolicies*/, RedisArgument } from './lib/RESP/types';
|
export {
|
||||||
|
/* CommandPolicies, */
|
||||||
|
RedisArgument,
|
||||||
|
RedisFunctions,
|
||||||
|
RedisModules,
|
||||||
|
RedisScripts,
|
||||||
|
RespVersions,
|
||||||
|
TypeMapping,
|
||||||
|
} from './lib/RESP/types';
|
||||||
export { RESP_TYPES } from './lib/RESP/decoder';
|
export { RESP_TYPES } from './lib/RESP/decoder';
|
||||||
export { VerbatimString } from './lib/RESP/verbatim-string';
|
export { VerbatimString } from './lib/RESP/verbatim-string';
|
||||||
export { defineScript } from './lib/lua-script';
|
export { defineScript } from './lib/lua-script';
|
||||||
@@ -7,6 +15,7 @@ export * from './lib/errors';
|
|||||||
import RedisClient, { RedisClientOptions, RedisClientType } from './lib/client';
|
import RedisClient, { RedisClientOptions, RedisClientType } from './lib/client';
|
||||||
export { RedisClientOptions, RedisClientType };
|
export { RedisClientOptions, RedisClientType };
|
||||||
export const createClient = RedisClient.create;
|
export const createClient = RedisClient.create;
|
||||||
|
export { CommandParser } from './lib/client/parser';
|
||||||
|
|
||||||
import { RedisClientPool, RedisPoolOptions, RedisClientPoolType } from './lib/client/pool';
|
import { RedisClientPool, RedisPoolOptions, RedisClientPoolType } from './lib/client/pool';
|
||||||
export { RedisClientPoolType, RedisPoolOptions };
|
export { RedisClientPoolType, RedisPoolOptions };
|
||||||
|
Reference in New Issue
Block a user