falkordb 4.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +366 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +44 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-2023, Redis, inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
# Node-Redis
|
|
2
|
+
|
|
3
|
+
[](https://github.com/redis/node-redis/actions/workflows/tests.yml)
|
|
4
|
+
[](https://codecov.io/gh/redis/node-redis)
|
|
5
|
+
[](https://github.com/redis/node-redis/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
[](https://discord.gg/redis)
|
|
8
|
+
[](https://www.twitch.tv/redisinc)
|
|
9
|
+
[](https://www.youtube.com/redisinc)
|
|
10
|
+
[](https://twitter.com/redisinc)
|
|
11
|
+
|
|
12
|
+
node-falkordb is a modern, high performance [FalkorDB](https://www.falkordb.com) client for Node.js.
|
|
13
|
+
|
|
14
|
+
## Packages
|
|
15
|
+
|
|
16
|
+
| Name | Description |
|
|
17
|
+
|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
18
|
+
| [falkordb](./) | [](https://www.npmjs.com/package/falkordb) [](https://www.npmjs.com/package/redis) |
|
|
19
|
+
| [@falkordb/client](./packages/client) | [](https://www.npmjs.com/package/@falkordb/client) [](https://www.npmjs.com/package/@falkordb/client) [](https://redis.js.org/documentation/client/) |
|
|
20
|
+
| [@falkordb/graph](./packages/graph) | [](https://www.npmjs.com/package/@falkordb/graph) [](https://www.npmjs.com/package/@falkordb/graph) [](https://redis.js.org/documentation/graph/) [Redis Graph](https://oss.redis.com/redisgraph/) commands |
|
|
21
|
+
|
|
22
|
+
> :warning: In version 4.1.0 we moved our subpackages from `@node-redis` to `@falkordb`. If you're just using `npm install redis`, you don't need to do anything—it'll upgrade automatically. If you're using the subpackages directly, you'll need to point to the new scope (e.g. `@falkordb/client` instead of `@node-falkordb/client`).
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Start a redis via docker:
|
|
27
|
+
|
|
28
|
+
``` bash
|
|
29
|
+
docker run -p 6379:6379 -it redis/redis-stack-server:latest
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
To install node-redis, simply:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install redis
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
> :warning: The new interface is clean and cool, but if you have an existing codebase, you'll want to read the [migration guide](./docs/v3-to-v4.md).
|
|
39
|
+
|
|
40
|
+
Looking for a high-level library to handle object mapping? See [redis-om-node](https://github.com/redis/redis-om-node)!
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
### Basic Example
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { createClient } from 'redis';
|
|
48
|
+
|
|
49
|
+
const client = await createClient()
|
|
50
|
+
.on('error', err => console.log('Redis Client Error', err))
|
|
51
|
+
.connect();
|
|
52
|
+
|
|
53
|
+
await client.set('key', 'value');
|
|
54
|
+
const value = await client.get('key');
|
|
55
|
+
await client.disconnect();
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The above code connects to localhost on port 6379. To connect to a different host or port, use a connection string in the format `redis[s]://[[username][:password]@][host][:port][/db-number]`:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
createClient({
|
|
62
|
+
url: 'redis://alice:foobared@awesome.redis.server:6380'
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
You can also use discrete parameters, UNIX sockets, and even TLS to connect. Details can be found in the [client configuration guide](./docs/client-configuration.md).
|
|
67
|
+
|
|
68
|
+
To check if the the client is connected and ready to send commands, use `client.isReady` which returns a boolean. `client.isOpen` is also available. This returns `true` when the client's underlying socket is open, and `false` when it isn't (for example when the client is still connecting or reconnecting after a network error).
|
|
69
|
+
|
|
70
|
+
### Redis Commands
|
|
71
|
+
|
|
72
|
+
There is built-in support for all of the [out-of-the-box Redis commands](https://redis.io/commands). They are exposed using the raw Redis command names (`HSET`, `HGETALL`, etc.) and a friendlier camel-cased version (`hSet`, `hGetAll`, etc.):
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
// raw Redis commands
|
|
76
|
+
await client.HSET('key', 'field', 'value');
|
|
77
|
+
await client.HGETALL('key');
|
|
78
|
+
|
|
79
|
+
// friendly JavaScript commands
|
|
80
|
+
await client.hSet('key', 'field', 'value');
|
|
81
|
+
await client.hGetAll('key');
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Modifiers to commands are specified using a JavaScript object:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
await client.set('key', 'value', {
|
|
88
|
+
EX: 10,
|
|
89
|
+
NX: true
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Replies will be transformed into useful data structures:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
await client.hGetAll('key'); // { field1: 'value1', field2: 'value2' }
|
|
97
|
+
await client.hVals('key'); // ['value1', 'value2']
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`Buffer`s are supported as well:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
await client.hSet('key', 'field', Buffer.from('value')); // 'OK'
|
|
104
|
+
await client.hGetAll(
|
|
105
|
+
commandOptions({ returnBuffers: true }),
|
|
106
|
+
'key'
|
|
107
|
+
); // { field: <Buffer 76 61 6c 75 65> }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Unsupported Redis Commands
|
|
111
|
+
|
|
112
|
+
If you want to run commands and/or use arguments that Node Redis doesn't know about (yet!) use `.sendCommand()`:
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
await client.sendCommand(['SET', 'key', 'value', 'NX']); // 'OK'
|
|
116
|
+
|
|
117
|
+
await client.sendCommand(['HGETALL', 'key']); // ['key1', 'field1', 'key2', 'field2']
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Transactions (Multi/Exec)
|
|
121
|
+
|
|
122
|
+
Start a [transaction](https://redis.io/topics/transactions) by calling `.multi()`, then chaining your commands. When you're done, call `.exec()` and you'll get an array back with your results:
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
await client.set('another-key', 'another-value');
|
|
126
|
+
|
|
127
|
+
const [setKeyReply, otherKeyValue] = await client
|
|
128
|
+
.multi()
|
|
129
|
+
.set('key', 'value')
|
|
130
|
+
.get('another-key')
|
|
131
|
+
.exec(); // ['OK', 'another-value']
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
You can also [watch](https://redis.io/topics/transactions#optimistic-locking-using-check-and-set) keys by calling `.watch()`. Your transaction will abort if any of the watched keys change.
|
|
135
|
+
|
|
136
|
+
To dig deeper into transactions, check out the [Isolated Execution Guide](./docs/isolated-execution.md).
|
|
137
|
+
|
|
138
|
+
### Blocking Commands
|
|
139
|
+
|
|
140
|
+
Any command can be run on a new connection by specifying the `isolated` option. The newly created connection is closed when the command's `Promise` is fulfilled.
|
|
141
|
+
|
|
142
|
+
This pattern works especially well for blocking commands—such as `BLPOP` and `BLMOVE`:
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
import { commandOptions } from 'redis';
|
|
146
|
+
|
|
147
|
+
const blPopPromise = client.blPop(
|
|
148
|
+
commandOptions({ isolated: true }),
|
|
149
|
+
'key',
|
|
150
|
+
0
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
await client.lPush('key', ['1', '2']);
|
|
154
|
+
|
|
155
|
+
await blPopPromise; // '2'
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
To learn more about isolated execution, check out the [guide](./docs/isolated-execution.md).
|
|
159
|
+
|
|
160
|
+
### Pub/Sub
|
|
161
|
+
|
|
162
|
+
See the [Pub/Sub overview](./docs/pub-sub.md).
|
|
163
|
+
|
|
164
|
+
### Scan Iterator
|
|
165
|
+
|
|
166
|
+
[`SCAN`](https://redis.io/commands/scan) results can be looped over using [async iterators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator):
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
for await (const key of client.scanIterator()) {
|
|
170
|
+
// use the key!
|
|
171
|
+
await client.get(key);
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
This works with `HSCAN`, `SSCAN`, and `ZSCAN` too:
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
for await (const { field, value } of client.hScanIterator('hash')) {}
|
|
179
|
+
for await (const member of client.sScanIterator('set')) {}
|
|
180
|
+
for await (const { score, value } of client.zScanIterator('sorted-set')) {}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
You can override the default options by providing a configuration object:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
client.scanIterator({
|
|
187
|
+
TYPE: 'string', // `SCAN` only
|
|
188
|
+
MATCH: 'patter*',
|
|
189
|
+
COUNT: 100
|
|
190
|
+
});
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### [Programmability](https://redis.io/docs/manual/programmability/)
|
|
194
|
+
|
|
195
|
+
Redis provides a programming interface allowing code execution on the redis server.
|
|
196
|
+
|
|
197
|
+
#### [Functions](https://redis.io/docs/manual/programmability/functions-intro/)
|
|
198
|
+
|
|
199
|
+
The following example retrieves a key in redis, returning the value of the key, incremented by an integer. For example, if your key _foo_ has the value _17_ and we run `add('foo', 25)`, it returns the answer to Life, the Universe and Everything.
|
|
200
|
+
|
|
201
|
+
```lua
|
|
202
|
+
#!lua name=library
|
|
203
|
+
|
|
204
|
+
redis.register_function {
|
|
205
|
+
function_name = 'add',
|
|
206
|
+
callback = function(keys, args) return redis.call('GET', keys[1]) + args[1] end,
|
|
207
|
+
flags = { 'no-writes' }
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Here is the same example, but in a format that can be pasted into the `redis-cli`.
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
FUNCTION LOAD "#!lua name=library\nredis.register_function{function_name=\"add\", callback=function(keys, args) return redis.call('GET', keys[1])+args[1] end, flags={\"no-writes\"}}"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Load the prior redis function on the _redis server_ before running the example below.
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
import { createClient } from 'redis';
|
|
221
|
+
|
|
222
|
+
const client = createClient({
|
|
223
|
+
functions: {
|
|
224
|
+
library: {
|
|
225
|
+
add: {
|
|
226
|
+
NUMBER_OF_KEYS: 1,
|
|
227
|
+
transformArguments(key: string, toAdd: number): Array<string> {
|
|
228
|
+
return [key, toAdd.toString()];
|
|
229
|
+
},
|
|
230
|
+
transformReply(reply: number): number {
|
|
231
|
+
return reply;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
await client.connect();
|
|
239
|
+
|
|
240
|
+
await client.set('key', '1');
|
|
241
|
+
await client.library.add('key', 2); // 3
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
#### [Lua Scripts](https://redis.io/docs/manual/programmability/eval-intro/)
|
|
245
|
+
|
|
246
|
+
The following is an end-to-end example of the prior concept.
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
import { createClient, defineScript } from 'redis';
|
|
250
|
+
|
|
251
|
+
const client = createClient({
|
|
252
|
+
scripts: {
|
|
253
|
+
add: defineScript({
|
|
254
|
+
NUMBER_OF_KEYS: 1,
|
|
255
|
+
SCRIPT:
|
|
256
|
+
'return redis.call("GET", KEYS[1]) + ARGV[1];',
|
|
257
|
+
transformArguments(key: string, toAdd: number): Array<string> {
|
|
258
|
+
return [key, toAdd.toString()];
|
|
259
|
+
},
|
|
260
|
+
transformReply(reply: number): number {
|
|
261
|
+
return reply;
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
await client.connect();
|
|
268
|
+
|
|
269
|
+
await client.set('key', '1');
|
|
270
|
+
await client.add('key', 2); // 3
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Disconnecting
|
|
274
|
+
|
|
275
|
+
There are two functions that disconnect a client from the Redis server. In most scenarios you should use `.quit()` to ensure that pending commands are sent to Redis before closing a connection.
|
|
276
|
+
|
|
277
|
+
#### `.QUIT()`/`.quit()`
|
|
278
|
+
|
|
279
|
+
Gracefully close a client's connection to Redis, by sending the [`QUIT`](https://redis.io/commands/quit) command to the server. Before quitting, the client executes any remaining commands in its queue, and will receive replies from Redis for each of them.
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
const [ping, get, quit] = await Promise.all([
|
|
283
|
+
client.ping(),
|
|
284
|
+
client.get('key'),
|
|
285
|
+
client.quit()
|
|
286
|
+
]); // ['PONG', null, 'OK']
|
|
287
|
+
|
|
288
|
+
try {
|
|
289
|
+
await client.get('key');
|
|
290
|
+
} catch (err) {
|
|
291
|
+
// ClosedClient Error
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
#### `.disconnect()`
|
|
296
|
+
|
|
297
|
+
Forcibly close a client's connection to Redis immediately. Calling `disconnect` will not send further pending commands to the Redis server, or wait for or parse outstanding responses.
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
await client.disconnect();
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Auto-Pipelining
|
|
304
|
+
|
|
305
|
+
Node Redis will automatically pipeline requests that are made during the same "tick".
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
client.set('Tm9kZSBSZWRpcw==', 'users:1');
|
|
309
|
+
client.sAdd('users:1:tokens', 'Tm9kZSBSZWRpcw==');
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Of course, if you don't do something with your Promises you're certain to get [unhandled Promise exceptions](https://nodejs.org/api/process.html#process_event_unhandledrejection). To take advantage of auto-pipelining and handle your Promises, use `Promise.all()`.
|
|
313
|
+
|
|
314
|
+
```typescript
|
|
315
|
+
await Promise.all([
|
|
316
|
+
client.set('Tm9kZSBSZWRpcw==', 'users:1'),
|
|
317
|
+
client.sAdd('users:1:tokens', 'Tm9kZSBSZWRpcw==')
|
|
318
|
+
]);
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Clustering
|
|
322
|
+
|
|
323
|
+
Check out the [Clustering Guide](./docs/clustering.md) when using Node Redis to connect to a Redis Cluster.
|
|
324
|
+
|
|
325
|
+
### Events
|
|
326
|
+
|
|
327
|
+
The Node Redis client class is an Nodejs EventEmitter and it emits an event each time the network status changes:
|
|
328
|
+
|
|
329
|
+
| Name | When | Listener arguments |
|
|
330
|
+
|-------------------------|------------------------------------------------------------------------------------|------------------------------------------------------------|
|
|
331
|
+
| `connect` | Initiating a connection to the server | *No arguments* |
|
|
332
|
+
| `ready` | Client is ready to use | *No arguments* |
|
|
333
|
+
| `end` | Connection has been closed (via `.quit()` or `.disconnect()`) | *No arguments* |
|
|
334
|
+
| `error` | An error has occurred—usually a network issue such as "Socket closed unexpectedly" | `(error: Error)` |
|
|
335
|
+
| `reconnecting` | Client is trying to reconnect to the server | *No arguments* |
|
|
336
|
+
| `sharded-channel-moved` | See [here](./docs/pub-sub.md#sharded-channel-moved-event) | See [here](./docs/pub-sub.md#sharded-channel-moved-event) |
|
|
337
|
+
|
|
338
|
+
> :warning: You **MUST** listen to `error` events. If a client doesn't have at least one `error` listener registered and an `error` occurs, that error will be thrown and the Node.js process will exit. See the [`EventEmitter` docs](https://nodejs.org/api/events.html#events_error_events) for more details.
|
|
339
|
+
|
|
340
|
+
> The client will not emit [any other events](./docs/v3-to-v4.md#all-the-removed-events) beyond those listed above.
|
|
341
|
+
|
|
342
|
+
## Supported Redis versions
|
|
343
|
+
|
|
344
|
+
Node Redis is supported with the following versions of Redis:
|
|
345
|
+
|
|
346
|
+
| Version | Supported |
|
|
347
|
+
|---------|--------------------|
|
|
348
|
+
| 7.0.z | :heavy_check_mark: |
|
|
349
|
+
| 6.2.z | :heavy_check_mark: |
|
|
350
|
+
| 6.0.z | :heavy_check_mark: |
|
|
351
|
+
| 5.0.z | :heavy_check_mark: |
|
|
352
|
+
| < 5.0 | :x: |
|
|
353
|
+
|
|
354
|
+
> Node Redis should work with older versions of Redis, but it is not fully tested and we cannot offer support.
|
|
355
|
+
|
|
356
|
+
## Contributing
|
|
357
|
+
|
|
358
|
+
If you'd like to contribute, check out the [contributing guide](CONTRIBUTING.md).
|
|
359
|
+
|
|
360
|
+
Thank you to all the people who already contributed to Node Redis!
|
|
361
|
+
|
|
362
|
+
[](https://github.com/redis/node-redis/graphs/contributors)
|
|
363
|
+
|
|
364
|
+
## License
|
|
365
|
+
|
|
366
|
+
This repository is licensed under the "MIT" license. See [LICENSE](LICENSE).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RedisModules, RedisFunctions, RedisScripts, RedisClientOptions, RedisClientType as _RedisClientType, RedisClusterOptions, RedisClusterType as _RedisClusterType } from '@falkordb/client';
|
|
2
|
+
export * from '@falkordb/client';
|
|
3
|
+
export * from '@falkordb/graph';
|
|
4
|
+
declare const modules: {
|
|
5
|
+
graph: {
|
|
6
|
+
CONFIG_GET: typeof import("@falkordb/graph/dist/commands/CONFIG_GET");
|
|
7
|
+
configGet: typeof import("@falkordb/graph/dist/commands/CONFIG_GET");
|
|
8
|
+
CONFIG_SET: typeof import("@falkordb/graph/dist/commands/CONFIG_SET");
|
|
9
|
+
configSet: typeof import("@falkordb/graph/dist/commands/CONFIG_SET");
|
|
10
|
+
DELETE: typeof import("@falkordb/graph/dist/commands/DELETE");
|
|
11
|
+
delete: typeof import("@falkordb/graph/dist/commands/DELETE");
|
|
12
|
+
EXPLAIN: typeof import("@falkordb/graph/dist/commands/EXPLAIN");
|
|
13
|
+
explain: typeof import("@falkordb/graph/dist/commands/EXPLAIN");
|
|
14
|
+
LIST: typeof import("@falkordb/graph/dist/commands/LIST");
|
|
15
|
+
list: typeof import("@falkordb/graph/dist/commands/LIST");
|
|
16
|
+
PROFILE: typeof import("@falkordb/graph/dist/commands/PROFILE");
|
|
17
|
+
profile: typeof import("@falkordb/graph/dist/commands/PROFILE");
|
|
18
|
+
QUERY: typeof import("@falkordb/graph/dist/commands/QUERY");
|
|
19
|
+
query: typeof import("@falkordb/graph/dist/commands/QUERY");
|
|
20
|
+
RO_QUERY: typeof import("@falkordb/graph/dist/commands/RO_QUERY");
|
|
21
|
+
roQuery: typeof import("@falkordb/graph/dist/commands/RO_QUERY");
|
|
22
|
+
SLOWLOG: typeof import("@falkordb/graph/dist/commands/SLOWLOG");
|
|
23
|
+
slowLog: typeof import("@falkordb/graph/dist/commands/SLOWLOG");
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type RedisDefaultModules = typeof modules;
|
|
27
|
+
export type RedisClientType<M extends RedisModules = RedisDefaultModules, F extends RedisFunctions = Record<string, never>, S extends RedisScripts = Record<string, never>> = _RedisClientType<M, F, S>;
|
|
28
|
+
export declare function createClient<M extends RedisModules, F extends RedisFunctions, S extends RedisScripts>(options?: RedisClientOptions<M, F, S>): _RedisClientType<RedisDefaultModules & M, F, S>;
|
|
29
|
+
export type RedisClusterType<M extends RedisModules = RedisDefaultModules, F extends RedisFunctions = Record<string, never>, S extends RedisScripts = Record<string, never>> = _RedisClusterType<M, F, S>;
|
|
30
|
+
export declare function createCluster<M extends RedisModules, F extends RedisFunctions, S extends RedisScripts>(options: RedisClusterOptions<M, F, S>): RedisClusterType<RedisDefaultModules & M, F, S>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.createCluster = exports.createClient = void 0;
|
|
18
|
+
const client_1 = require("@falkordb/client");
|
|
19
|
+
const graph_1 = require("@falkordb/graph");
|
|
20
|
+
__exportStar(require("@falkordb/client"), exports);
|
|
21
|
+
__exportStar(require("@falkordb/graph"), exports);
|
|
22
|
+
const modules = {
|
|
23
|
+
graph: graph_1.default,
|
|
24
|
+
};
|
|
25
|
+
function createClient(options) {
|
|
26
|
+
return (0, client_1.createClient)({
|
|
27
|
+
...options,
|
|
28
|
+
modules: {
|
|
29
|
+
...modules,
|
|
30
|
+
...options?.modules
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
exports.createClient = createClient;
|
|
35
|
+
function createCluster(options) {
|
|
36
|
+
return (0, client_1.createCluster)({
|
|
37
|
+
...options,
|
|
38
|
+
modules: {
|
|
39
|
+
...modules,
|
|
40
|
+
...options?.modules
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.createCluster = createCluster;
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "falkordb",
|
|
3
|
+
"description": "A modern, high performance FalkorDB client",
|
|
4
|
+
"version": "4.6.11",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/"
|
|
10
|
+
],
|
|
11
|
+
"workspaces": [
|
|
12
|
+
"./packages/*"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "npm run test -ws --if-present",
|
|
16
|
+
"build:client": "npm run build -w ./packages/client",
|
|
17
|
+
"build:test-utils": "npm run build -w ./packages/test-utils",
|
|
18
|
+
"build:tests-tools": "npm run build:client && npm run build:test-utils",
|
|
19
|
+
"build:modules": "find ./packages -mindepth 1 -maxdepth 1 -type d ! -name 'client' ! -name 'test-utils' -exec npm run build -w {} \\;",
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"build-all": "npm run build:client && npm run build:test-utils && npm run build:modules && npm run build",
|
|
22
|
+
"documentation": "npm run documentation -ws --if-present",
|
|
23
|
+
"gh-pages": "gh-pages -d ./documentation -e ./documentation -u 'github-actions-bot <support+actions@github.com>'"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@falkordb/client": "1.5.11",
|
|
27
|
+
"@falkordb/graph": "1.1.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@tsconfig/node14": "^14.1.0",
|
|
31
|
+
"gh-pages": "^6.0.0",
|
|
32
|
+
"release-it": "^16.1.5",
|
|
33
|
+
"typescript": "^5.2.2"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git://github.com/falkordb/node-falkordb.git"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/falkordb/node-falkordb/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/falkordb/node-falkordb",
|
|
43
|
+
"keywords": [
|
|
44
|
+
"falkordb",
|
|
45
|
+
"graph"
|
|
46
|
+
]
|
|
47
|
+
}
|