Skip to content

Export CommandParser from client index file and fix doc #2945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions docs/programmability.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

```typescript
import { CommandParser } from '@redis/client/lib/client/parser';
import { NumberReply } from '@redis/client/lib/RESP/types';
import { createClient, RedisArgument } from 'redis';
import { CommandParser, createClient, RedisArgument } from '@redis/client';
import { NumberReply } from '@redis/client/dist/lib/RESP/types.js';

const client = createClient({
functions: {
Expand Down Expand Up @@ -58,9 +57,8 @@ await client.library.add('key', '2'); // 3
The following is an end-to-end example of the prior concept.

```typescript
import { CommandParser } from '@redis/client/lib/client/parser';
import { NumberReply } from '@redis/client/lib/RESP/types';
import { createClient, defineScript, RedisArgument } from 'redis';
import { CommandParser, createClient, defineScript, RedisArgument } from '@redis/client';
import { NumberReply } from '@redis/client/dist/lib/RESP/types.js';

const client = createClient({
scripts: {
Expand Down
11 changes: 10 additions & 1 deletion packages/client/index.ts
Original file line number Diff line number Diff line change
@@ -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 { VerbatimString } from './lib/RESP/verbatim-string';
export { defineScript } from './lib/lua-script';
Expand All @@ -7,6 +15,7 @@ export * from './lib/errors';
import RedisClient, { RedisClientOptions, RedisClientType } from './lib/client';
export { RedisClientOptions, RedisClientType };
export const createClient = RedisClient.create;
export { CommandParser } from './lib/client/parser';

import { RedisClientPool, RedisPoolOptions, RedisClientPoolType } from './lib/client/pool';
export { RedisClientPoolType, RedisPoolOptions };
Expand Down
Loading