1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-01 16:46:54 +03:00

100 Commits

Author SHA1 Message Date
9c3c42f113 Add(examples): Create an example for blPop & lPush (#1696)
* Add(examples): Create an example for blPop & lPush

Signed-off-by: Aditya Rastogi <adit.rastogi2014@gmail.com>

* Update(examples): fix case, add timeout, update readme

Signed-off-by: Aditya Rastogi <adit.rastogi2014@gmail.com>

Closes #1693.
2021-10-25 23:43:47 +01:00
9a4ac34f18 Add lua-multi-incr.js example (#1692)
Also fix syntax error in the lua example in the README

Closes #1689.
2021-10-25 23:31:19 +01:00
55391557ca Made examples use local version. 2021-10-25 22:53:22 +01:00
dec504851e Adds TypeScript note and corrects a typo. 2021-10-21 21:48:29 +01:00
46aad787eb Updated examples to use named functions. (#1687)
* Updated examples to user named functions.

* Update README.md

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2021-10-19 16:13:35 -04:00
a5eb16595f Adds examples table of contents and contribution guidelines. (#1686) 2021-10-19 09:33:00 -04:00
55cfee5d32 move examples 2021-10-18 18:23:50 -04:00
26774f8fa3 Adds connect-as-acl-user example. (#1684)
* Adds connect-as-acl-user example.

* Adds blank line at end.

* Set to private.

* Adds examples folder to npmignore.
2021-10-18 18:20:00 -04:00
4e6d018d77 V4 (#1624)
* init v4

* add .gitignore to benchmark

* spawn redis-servers for tests,
add some tests,
fix client auth on connect

* add tests coverage report

* add tests workflow, replace nyc text reporter with text-summary

* run tests with node 16.x & redis 6.x only (for now)

* add socket events on client,
stop reconnectiong when manually calling disconnect,
remove abort signal listener when a command is written on the socket

* add isOpen boolean getter on client, add maxLength option to command queue, add test for client.multi

* move to use CommonJS

* add MULTI and EXEC commands to when executing multi command, make client.multi return type innerit the module commands, clean some tests, exclute spec files from coverage report

* missing file from commit 61edd4f1b5

* exclude spec files from coverage report

* add support for options in a command function (.get, .set, ...), add support for the SELECT command, implement a couple of commands, fix client socket reconnection strategy, add support for using replicas (RO) in cluster, and more..

* fix client.blPop test

* use which to find redis-server path

* change command options to work with Symbol rather then WeakSet

* implement more commands

* Add support for lua scripts in client & muilti, fix client socket initiator, implement simple cluster nodes discovery strategy

* replace `callbackify` with `legacyMode`

* add the SCAN command and client.scanIterator

* rename scanIterator

* init benchmark workflow

* fix benchmark workflow

* fix benchmark workflow

* fix benchmark workflow

* push coverage report to Coveralls

* fix Coveralls

* generator lcov (for Coveralls)

* fix .nycrc.json

* PubSub

* add support for all set commands (including sScanIterator)

* support pipeline

* fix KEEPTTL in SET

* remove console.log

* add HyperLogLog commands

* update README.md (thanks to @guyroyse)

* add support for most of the "keys commands"

* fix EXPIREAT.spec.ts

* add support for date in both EXPIREAT & EXPIRE

* add tests

* better cluster nodes discorvery strategy after MOVED error, add PubSub test

* fix PubSub UNSUBSCRIBE/PUNSUBSCRIBE without channel and/or listener

* fix PubSub

* add release-it to dev dependencies

* Release 4.0.0-next.0

* fix .npmignore

* Release 4.0.0-next.1

* fix links in README.md

* fix .npmignore

* Release 4.0.0-next.2

* add support for all sorted set commands

* add support for most stream commands

* add missing file from commit 53de279afe

* lots of todo commends

* make PubSub test more stable

* clean ZPOPMAX

* add support for lua scripts and modules in cluster, spawn cluster for tests, add some cluster tests, fix pubsub listener arguments

* GET.spec.ts

* add support for List commands, fix some Sorted Set commands, add some cluster commands, spawn cluster for testing, add support for command options in cluster, and more

* add missing file from commit faab94fab2

* clean ZRANK and ZREVRANK

* add XREAD and XREADGROUP commands

* remove unused files

* implement a couple of more commands, make cluster random iterator be per node (instead of per slot)

* Release 4.0.0-next.3

* app spec files to npmignore

* fix some code analyzers (LGTM, deepsource, codeclimate) issues

* fix CLUSTER_NODES, add some tests

* add HSCAN, clean some commands, add tests for generic transformers

* add missing files from 0feb35a1fb

* update README.md (thanks to @guyroyse)

* handle ASK errors, add some commands and tests

* Release 4.0.0-next.4

* replace "modern" with "v4"

* remove unused imports

* add all ACL subcommands, all MODULE subcommands, and some other commands

* remove 2 unused imports

* fix BITFIELD command

* fix XTRIM spec file

* clean code

* fix package.json types field

* better modules support, fix some bugs in legacy mode, add some tests

* remove unused function

* add test for hScanIterator

* change node mimimum version to 12 (latest LTS)

* update tsconfig.json to support node 12, run tests on Redis 5 & 6 and on all node live versions

* remove future node releases :P

* remove "lib" from ts compiler options

* Update tsconfig.json

* fix build

* run some tests only on supported redis versions, use coveralls parallel mode

* fix tests

* Do not use "timers/promises", fix "isRedisVersionGreaterThan"

* skip AbortController tests when not available

* use 'fs'.promises instead of 'fs/promises'

* add some missing commands

* run GETDEL tests only if the redis version is greater than 6.2

* implement some GEO commands, improve scan generic transformer, expose RPUSHX

* fix GEOSEARCH & GEOSEARCHSTORE

* use socket.setNoDelay and queueMicrotask to improve latency

* commands-queue.ts: String length / byte length counting issue (#1630)

* Update commands-queue.ts

Hopefully fixing #1628

* Reverted 2fa5ea6, and implemented test for byte length check

* Changed back to Buffer.byteLength, due to issue author input. Updated test to look for 4 bytes.

* Fixed. There were two places that length was calculated.

* Removed redundant string assignment

* add 2 bytes test as well

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>

* fix scripts in multi

* do not hide bugs in redis

* fix for e7bf09644b

* remove unused import

* implement WATCH command, fix ZRANGESTORE & GEOSEARCHSTORE tests

* update README.md

Co-authored-by: @GuyRoyse

* use typedoc to auto generate documentation

* run "npm install" before "npm run documentation"

* clean documentation workflow

* fix WATCH spec file

* increase "CLUSTER_NODE_TIMEOUT" to 5000ms to avoid "CLUSTERDOWN" errors in tests

* pull cluster state every 100 ms

* await meetPromises before pulling the cluster state

* enhance the way commanders (client/multi/cluster) get extended with modules and scripts

* add test for socket retry strategy

* implement more commands

* set GETEX minimum version to 6.2

* remove unused imports

* add support for multi in cluster

* upgrade dependencies

* Release 4.0.0-next.5

* remove unused imports

* improve benchmarking

* use the same Multi with duplicated clients

* exclude some files from the documentation, add some exports, clean code

* fix #1636 - handle null in multi.exec

* remove unused import

* add supoprt for tuples in HSET

* add FIRST_KEY_INDEX to HSET

* add a bunch of missing commands, fix MSET and HELLO, add some tests

* add FIRST_KEY_INDEX to MSET and MSETNX

* upgrade actions

* fix coverallsapp/github-action version

* Update documentation.yml

* Update documentation.yml

* clean code

* remove unused imports

* use "npm ci" instead of "npm install"

* fix `self` binding on client modules, use connection pool for `duplicateConnection`

* add client.executeIsolated, rename "duplicateConnection" to "isolated", update README.md (thanks to @GuyRoyse and @SimonPrickett)

* update README (thanks to @GuyRoyse), add some tests

* try to fix "cluster is down" errors in tests

* try to fix "cluster is down" errors in tests

* upgrade dependencies

* update package-lock

* Release 4.0.0-next.6

* fix #1636 - fix WatchError

* fix for f1bf0beebf - remove .only from multi tests

* Release 4.0.0-next.7

* update README and other markdown files

Co-authored-by: @GuyRoyse & @SimonPrickett

* Doc updates. (#1640)

* update docs, upgrade dependencies

* fix README

* Release 4.0.0-rc.0

* Update README.md

* update docs, add `connectTimeout` options, fix tls

Co-authored-by: Guy Royse <guy@guyroyse.com>

* npm update, "fix" some tests, clean code

* fix AssertionError import

* fix #1642 - fix XREAD, XREADGROUP and XTRIM

* fix #1644 - add the QUIT command

* add socket.noDelay and socket.keepAlive configurations

* Update README.md (#1645)

* Update README.md

Fixed issue with how connection string was specified.
Now you can have user@host without having to specify a password, which just makes more sense

* Update client-configuration.md as well

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>

* update socket.reconnectStrategy description

* fix borken link in v3-to-v4.md

* increase test coverage, fix bug in cluster redirection strategy, implement CLIENT_ID, remove unused EXEC command

Co-authored-by: Nova <novaw@warrenservices.co.uk>
Co-authored-by: Simon Prickett <simon@crudworks.org>
Co-authored-by: Guy Royse <guy@guyroyse.com>
2021-09-02 10:04:48 -04:00
78936ac50c feat(parser): update to latest Redis parser & errors (#1470)
* Update redis errors and redis parser
* Fix lint errors
* Add node 12 to travis ci
* Add appveyor node 12
* Fix some of existing errors

This drops support for hiredis.
2020-02-03 17:53:56 +00:00
383f097029 Added 'NOACK' to xreadgroup call
Added 'NOACK' to xreadgroup call, to make sure entries are auto ACK
2018-11-14 04:51:56 +02:00
96fdc7794b add a simple streams example 2018-11-12 17:36:41 +02:00
94e9f1fcfc Replace jshint with eslint and add lots of rules
Fix eslint errors accordingly
2016-03-26 14:45:12 +01:00
ddbb94b598 Fix file example
Fixes #176
2016-03-21 17:22:00 +01:00
545e7231ab Update SCAN example code 2016-01-31 12:25:35 +02:00
afc4989495 Remove command queue high and low water marks 2015-10-28 23:53:10 +01:00
7922d4eb85 Small style changes 2015-10-07 16:34:41 +02:00
06c5f1922b Add jshint and fix errors accordingly (including broken tests) 2015-09-12 18:56:49 +02:00
1eb30add66 Use util.debuglog instead of using different indidivudal styles for debugging 2015-09-02 21:49:11 +02:00
6866ff9b1e Remove trailing whitespace 2015-07-22 17:51:08 +02:00
a2bc597212 Add simicolons
This is just a style change
2015-07-22 17:51:07 +02:00
1f9e536ca0 Add use strict statements
This is going to improve the performance minimal and improves the safety of the code
2015-07-22 17:50:37 +02:00
ff020d37f3 Clarified COUNT's behavior. scan() now will run until cursor reaches 0. 2015-07-10 18:04:38 -07:00
6f28c6acf5 Cursor should be a string 2015-07-10 16:25:52 -07:00
010a2acf33 Added example of a Redis SCAN command 2015-07-10 16:10:00 -07:00
938c0526a0 EVAL: allow parameters as an array. Close #368.
Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
2013-02-23 22:05:34 -05:00
6a09b2d1a3 fix require in examples/eval.js 2013-02-17 19:06:36 -05:00
ff9ac4bf34 Add eval example. 2011-11-14 20:43:32 -10:00
6e38f4d6e0 Merge pull request #146 from maks/master
added sort example
2011-11-13 21:09:25 -08:00
f2a6a20a74 Send quit command right away.
The quit/pipeline bug has been fixed in Redis server for some time now.
2011-11-13 18:10:22 -10:00
804970f895 added handy example of using sort command using code posted by linus in mranney/node_redis/#103 2011-10-27 15:11:12 +11:00
3cc297ada4 Contributed changes:
*  Support SlowBuffers (Umair Siddique)
*  Add Multi to exports (Louis-Philippe Perron)
*  Fix for drain event calculation (Vladimir Dronnikov)

Thanks!
2011-07-06 09:49:40 -05:00
886b3355e1 Bugs fixed:
*  authentication retry while server is loading db (danmaz74) [GH-101]
*  command arguments processing issue with arrays

New features:

*  Auto update of new commands from redis.io (Dave Hoover)
*  Performance improvements and backpressure controls.
*  Commands now return the true/false value from the underlying socket write(s).
*  Implement command_queue high water and low water for more better control of queueing.

See `examples/backpressure_drain.js` for more information.
2011-06-30 14:29:58 -06:00
f9e17556d2 Performance improvements and backpressure controls.
Simply and speed up command argument processing logic.
Commands now return the true/false value from the underlying socket write(s).
Implement command_queue high water and low water for more better control of queueing.
2011-06-30 14:12:35 -06:00
f10ff9e916 Lots of bugs fixed.
*  connection error did not properly trigger reconnection logic [GH-85]
*  client.hmget(key, [val1, val2]) was not expanding properly [GH-66]
*  client.quit() while in pub/sub mode would throw an error [GH-87]
*  client.multi(['hmset', 'key', {foo: 'bar'}]) fails [GH-92]
2011-04-21 16:48:14 -10:00
850d129629 Add monitor example. 2011-03-14 15:53:30 -10:00
1a14e24faa Add magical auth command.
Authentication is now remembered by the client and will be automatically sent to the server
on every connection, including any reconnections.
2011-02-27 23:10:44 -10:00
2534f740aa Update pub_sub example to show where to put auth. 2011-02-22 21:59:57 -10:00
b907364573 Support for multiple reply parsers including hiredis.
Several parsing bugs fixed in JavaScript.
Some new config options that need to be better documented.
2010-12-06 09:11:16 -08:00
232f34a4e1 Add Unix socket example. 2010-12-01 22:36:14 -08:00
95e60006f6 Add subqueries example. 2010-11-03 14:04:53 -07:00
1c5f73f541 Organize examples. 2010-10-20 16:38:33 -07:00
85bd648adc Export RedisClient prototype to support extending.
See examples/extend.js for a simple example.
Remove command list from exports while I was in there.
2010-10-05 11:30:57 -07:00
6fd6f7ad32 Merge remote branch 'hanksims/master' 2010-10-02 16:19:29 -07:00
b24edbecad Simple web server that integrates with Redis. 2010-10-02 16:17:29 -07:00
0ceb2c0f30 Added a psubscribe example. 2010-10-02 13:18:08 -07:00
fc5b7e00f8 Typo. 2010-09-24 14:16:22 -07:00
17b5082e79 Add example of alternate MULTI syntax. 2010-09-24 14:03:56 -07:00
6d1b96500e Update examples. 2010-09-24 14:02:51 -07:00
047d367f8c Organize things a little. 2010-09-24 13:15:37 -07:00