1
0
mirror of https://github.com/redis/node-redis.git synced 2025-07-31 05:44:24 +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:
Orgad Shaneh
2025-05-07 16:10:03 +03:00
committed by GitHub
parent 87b77e3e5f
commit bc4b2101ee
2 changed files with 14 additions and 7 deletions

View File

@ -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: {
@ -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: {