Skip to content

Commit c0cc0bf

Browse files
committed
start of work towards v3 release
1 parent 1d8fa45 commit c0cc0bf

18 files changed

+235
-401
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
open_collective: node-redis

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ coverage/
1111
*.rdb
1212
*.out
1313
*.yml
14+
CHANGELOG.md
15+
CONTRIBUTING.md
16+
CODE_OF_CONDUCT.md
17+
.travis.yml
18+
appveyor.yml
19+
package-lock.json

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ addons:
99
packages:
1010
- g++-4.8
1111
node_js:
12-
- "4"
1312
- "6"
1413
- "8"
1514
- "12"

changelog.md renamed to CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Changelog
22

3+
## v.3.0.0 - 09 Feb, 2020
4+
5+
This version is mainly a release to distribute all the unreleased changes on master since 2017 and additionally removes
6+
a lot of old deprecated features and old internals in preparation for an upcoming modernization refactor (v4).
7+
8+
### Breaking Changes
9+
10+
- Dropped support for Node.js < 6
11+
- Dropped support for `hiredis` (no longer required)
12+
- Removed previously deprecated `drain` event
13+
- Removed previously deprecated `idle` event
14+
- Removed previously deprecated `parser` option
15+
- Removed previously deprecated `max_delay` option
16+
- Removed previously deprecated `max_attempts` option
17+
- Removed previously deprecated `socket_no_delay` option
18+
19+
### Bug Fixes
20+
21+
- Removed development files from published package (#1370)
22+
- Duplicate function now allows db param to be passed (#1311)
23+
24+
### Features
25+
26+
- Upgraded to latest `redis-commands` package
27+
- Upgraded to latest `redis-parser` package, v3.0.0, which brings performance improvements
28+
- Replaced `double-ended-queue` with `denque`, which brings performance improvements
29+
- Add timestamps to debug traces
30+
- Add `socket_initial_delay` option for `socket.setKeepAlive` (#1396)
31+
332
## v.2.8.0 - 31 Jul, 2017
433

534
Features

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at `redis @ invertase.io`. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- TODO -->

LICENSE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
LICENSE - "MIT License"
1+
MIT License
22

3-
Copyright (c) 2016 by NodeRedis
3+
Copyright (c) Node Redis contributors.
44

55
Permission is hereby granted, free of charge, to any person
66
obtaining a copy of this software and associated documentation
@@ -21,4 +21,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
2121
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2222
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2323
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24-
OTHER DEALINGS IN THE SOFTWARE.
24+
OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 23 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
redis - a node.js redis client
2-
===========================
3-
4-
[![Build Status](https://travis-ci.org/NodeRedis/node_redis.svg?branch=master)](https://travis-ci.org/NodeRedis/node_redis)
5-
[![Coverage Status](https://coveralls.io/repos/NodeRedis/node_redis/badge.svg?branch=)](https://coveralls.io/r/NodeRedis/node_redis?branch=)
6-
[![Windows Tests](https://img.shields.io/appveyor/ci/BridgeAR/node-redis/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/BridgeAR/node-redis/branch/master)
7-
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/NodeRedis/node_redis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1+
<p align="center">
2+
<a href="https://github.com/noderedis/node-redis/">
3+
<img width="160px" src="https://static.invertase.io/assets/node_redis_logo.png" />
4+
</a>
5+
<h2 align="center">Node Redis</h2>
6+
A high performance Node.js Redis client.
7+
</p>
8+
9+
<p align="center">
10+
<a href="https://www.npmjs.com/package/redis"><img src="https://img.shields.io/npm/dm/redis.svg?style=flat-square" alt="NPM downloads"></a>
11+
<a href="https://www.npmjs.com/package/redis"><img src="https://img.shields.io/npm/v/redis.svg?style=flat-square" alt="NPM version"></a>
12+
<a href="https://travis-ci.org/NodeRedis/node_redis"><img src="https://travis-ci.org/NodeRedis/node_redis.svg?style=flat-square&branch=master" alt="Build Status" /></a>
13+
<a href="https://coveralls.io/r/NodeRedis/node_redis?branch="><img src="https://coveralls.io/repos/NodeRedis/node_redis/badge.svg?style=flat-square&branch=" alt="Coverage Status" /></a>
14+
<a href="https://ci.appveyor.com/project/BridgeAR/node-redis/branch/master"><img src="https://img.shields.io/appveyor/ci/BridgeAR/node-redis/master.svg?style=flat-square&label=Windows%20Tests" alt="Windows Tests" /></a>
15+
<a href="https://twitter.com/rnfirebase"><img src="https://img.shields.io/twitter/follow/NodeRedis.svg?style=flat-square&colorA=1da1f2&colorB=&label=Follow%20on%20Twitter" alt="Follow on Twitter"></a>
16+
</p>
17+
18+
---
819

920
This is a complete and feature rich Redis client for node.js. __It supports all
1021
Redis commands__ and focuses on high performance.
@@ -195,30 +206,11 @@ So please attach the error listener to node_redis.
195206

196207
`client` will emit `end` when an established Redis server connection has closed.
197208

198-
### "drain" (deprecated)
199-
200-
`client` will emit `drain` when the TCP connection to the Redis server has been
201-
buffering, but is now writable. This event can be used to stream commands in to
202-
Redis and adapt to backpressure.
203-
204-
If the stream is buffering `client.should_buffer` is set to true. Otherwise the
205-
variable is always set to false. That way you can decide when to reduce your
206-
send rate and resume sending commands when you get `drain`.
207-
208-
You can also check the return value of each command as it will also return the
209-
backpressure indicator (deprecated). If false is returned the stream had to
210-
buffer.
211-
212209
### "warning"
213210

214211
`client` will emit `warning` when password was set but none is needed and if a
215212
deprecated option / function / similar is used.
216213

217-
### "idle" (deprecated)
218-
219-
`client` will emit `idle` when there are no outstanding commands that are
220-
awaiting a response.
221-
222214
## redis.createClient()
223215
If you have `redis-server` running on the same machine as node, then the
224216
defaults for port and host are probably fine and you don't need to supply any
@@ -242,17 +234,13 @@ __Note:__ Using `'rediss://...` for the protocol in a `redis_url` will enable a
242234
| port | 6379 | Port of the Redis server |
243235
| path | null | The UNIX socket string of the Redis server |
244236
| url | null | The URL of the Redis server. Format: `[redis[s]:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]` (More info avaliable at [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis)). |
245-
| parser | javascript | __Deprecated__ Use either the built-in JS parser [`javascript`]() or the native [`hiredis`]() parser. __Note__ `node_redis` < 2.6 uses hiredis as default if installed. This changed in v.2.6.0. |
246237
| string_numbers | null | Set to `true`, `node_redis` will return Redis number values as Strings instead of javascript Numbers. Useful if you need to handle big numbers (above `Number.MAX_SAFE_INTEGER === 2^53`). Hiredis is incapable of this behavior, so setting this option to `true` will result in the built-in javascript parser being used no matter the value of the `parser` option. |
247238
| return_buffers | false | If set to `true`, then all replies will be sent to callbacks as Buffers instead of Strings. |
248239
| detect_buffers | false | If set to `true`, then replies will be sent to callbacks as Buffers. This option lets you switch between Buffers and Strings on a per-command basis, whereas `return_buffers` applies to every command on a client. __Note__: This doesn't work properly with the pubsub mode. A subscriber has to either always return Strings or Buffers. |
249240
| socket_keepalive | true | If set to `true`, the keep-alive functionality is enabled on the underlying socket. |
250-
| socket_initialdelay | 0 | Initial Delay in milliseconds, and this will also behave the interval keep alive message sending to Redis. |
241+
| socket_initial_delay | 0 | Initial Delay in milliseconds, and this will also behave the interval keep alive message sending to Redis. |
251242
| no_ready_check | false | When a connection is established to the Redis server, the server might still be loading the database from disk. While loading, the server will not respond to any commands. To work around this, `node_redis` has a "ready check" which sends the `INFO` command to the server. The response from the `INFO` command indicates whether the server is ready for more commands. When ready, `node_redis` emits a `ready` event. Setting `no_ready_check` to `true` will inhibit this check. |
252243
| enable_offline_queue | true | By default, if there is no active connection to the Redis server, commands are added to a queue and are executed once the connection has been established. Setting `enable_offline_queue` to `false` will disable this feature and the callback will be executed immediately with an error, or an error will be emitted if no callback is specified. |
253-
| retry_max_delay | null | __Deprecated__ _Please use `retry_strategy` instead._ By default, every time the client tries to connect and fails, the reconnection delay almost doubles. This delay normally grows infinitely, but setting `retry_max_delay` limits it to the maximum value provided in milliseconds. |
254-
| connect_timeout | 3600000 | __Deprecated__ _Please use `retry_strategy` instead._ Setting `connect_timeout` limits the total time for the client to connect and reconnect. The value is provided in milliseconds and is counted from the moment a new client is created or from the time the connection is lost. The last retry is going to happen exactly at the timeout time. Default is to try connecting until the default system socket timeout has been exceeded and to try reconnecting until 1h has elapsed. |
255-
| max_attempts | 0 | __Deprecated__ _Please use `retry_strategy` instead._ By default, a client will try reconnecting until connected. Setting `max_attempts` limits total amount of connection attempts. Setting this to 1 will prevent any reconnect attempt. |
256244
| retry_unfulfilled_commands | false | If set to `true`, all commands that were unfulfilled while the connection is lost will be retried after the connection has been reestablished. Use this with caution if you use state altering commands (e.g. `incr`). This is especially useful if you use blocking commands. |
257245
| password | null | If set, client will run Redis auth command on connect. Alias `auth_pass` __Note__ `node_redis` < 2.5 must use `auth_pass` |
258246
| db | null | If set, client will run Redis `select` command on connect. |
@@ -473,12 +461,6 @@ client.hgetall("hosts", function (err, obj) {
473461
});
474462
```
475463

476-
Output:
477-
478-
```js
479-
{ mjr: '1', another: '23', home: '1234' }
480-
```
481-
482464
### client.hmset(hash, obj[, callback])
483465

484466
Multiple values in a hash can be set by supplying an object:
@@ -770,7 +752,7 @@ clients.alterer = clients.watcher.duplicate();
770752
clients.watcher.watch('foo',function(err) {
771753
if (err) { throw err; }
772754
//if you comment out the next line, the transaction will work
773-
clients.alterer.set('foo',Math.random(), (err) => {if (err) { throw err; }})
755+
clients.alterer.set('foo',Math.random(), (err) => {if (err) { throw err; }});
774756

775757
//using a setTimeout here to ensure that the MULTI/EXEC will come after the SET.
776758
//Normally, you would use a callback to ensure order, but I want the above SET command
@@ -897,8 +879,8 @@ the second word as first parameter:
897879

898880
```js
899881
client.script('load', 'return 1');
900-
client.multi().script('load', 'return 1').exec(...);
901-
client.multi([['script', 'load', 'return 1']]).exec(...);
882+
client.multi().script('load', 'return 1').exec();
883+
client.multi([['script', 'load', 'return 1']]).exec();
902884
```
903885

904886
## client.duplicate([options][, callback])
@@ -1082,6 +1064,7 @@ ReplyError: ERR wrong number of arguments for 'set' command
10821064
```
10831065

10841066
## How to Contribute
1067+
10851068
- Open a pull request or an issue about what you want to implement / change. We're glad for any help!
10861069
- Please be aware that we'll only accept fully tested code.
10871070

@@ -1097,23 +1080,3 @@ contributed to `node_redis` too. Thanks to all of them!
10971080
## License
10981081

10991082
[MIT](LICENSE)
1100-
1101-
### Consolidation: It's time for celebration
1102-
1103-
Right now there are two great redis clients around and both have some advantages
1104-
above each other. We speak about ioredis and node_redis. So after talking to
1105-
each other about how we could improve in working together we (that is @luin and
1106-
@BridgeAR) decided to work towards a single library on the long run. But step by
1107-
step.
1108-
1109-
First of all, we want to split small parts of our libraries into others so that
1110-
we're both able to use the same code. Those libraries are going to be maintained
1111-
under the NodeRedis organization. This is going to reduce the maintenance
1112-
overhead, allows others to use the very same code, if they need it and it's way
1113-
easyer for others to contribute to both libraries.
1114-
1115-
We're very happy about this step towards working together as we both want to
1116-
give you the best redis experience possible.
1117-
1118-
If you want to join our cause by help maintaining something, please don't
1119-
hesitate to contact either one of us.

appveyor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Test against these versions of Node.js.
44
environment:
55
matrix:
6-
- nodejs_version: "4"
76
- nodejs_version: "6"
87
- nodejs_version: "8"
98
- nodejs_version: "10"

0 commit comments

Comments
 (0)