You've already forked node-redis
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:
@ -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: {
|
||||
|
Reference in New Issue
Block a user