Skip to content

Commit f38247e

Browse files
committed
[doc] Sort options alphabetically
1 parent 142f091 commit f38247e

File tree

4 files changed

+41
-41
lines changed

4 files changed

+41
-41
lines changed

doc/ws.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@ This class represents a WebSocket server. It extends the `EventEmitter`.
6464
### new WebSocketServer(options[, callback])
6565

6666
- `options` {Object}
67-
- `host` {String} The hostname where to bind the server.
68-
- `port` {Number} The port where to bind the server.
6967
- `backlog` {Number} The maximum length of the queue of pending connections.
70-
- `server` {http.Server|https.Server} A pre-created Node.js HTTP/S server.
71-
- `verifyClient` {Function} A function which can be used to validate incoming
72-
connections. See description below. (Usage is discouraged: see
73-
[Issue #337](https://github.com/websockets/ws/issues/377#issuecomment-462152231))
68+
- `clientTracking` {Boolean} Specifies whether or not to track clients.
7469
- `handleProtocols` {Function} A function which can be used to handle the
7570
WebSocket subprotocols. See description below.
76-
- `path` {String} Accept only connections matching this path.
71+
- `host` {String} The hostname where to bind the server.
72+
- `maxPayload` {Number} The maximum allowed message size in bytes.
7773
- `noServer` {Boolean} Enable no server mode.
78-
- `clientTracking` {Boolean} Specifies whether or not to track clients.
74+
- `path` {String} Accept only connections matching this path.
7975
- `perMessageDeflate` {Boolean|Object} Enable/disable permessage-deflate.
80-
- `maxPayload` {Number} The maximum allowed message size in bytes.
76+
- `port` {Number} The port where to bind the server.
77+
- `server` {http.Server|https.Server} A pre-created Node.js HTTP/S server.
8178
- `skipUTF8Validation` {Boolean} Specifies whether or not to skip UTF-8
8279
validation for text and close messages. Defaults to `false`. Set to `true`
8380
only if clients are trusted.
81+
- `verifyClient` {Function} A function which can be used to validate incoming
82+
connections. See description below. (Usage is discouraged: see
83+
[Issue #337](https://github.com/websockets/ws/issues/377#issuecomment-462152231))
8484
- `callback` {Function}
8585

8686
Create a new server instance. One and only one of `port`, `server` or `noServer`
@@ -269,13 +269,13 @@ This class represents a WebSocket. It extends the `EventEmitter`.
269269
`false`.
270270
- `handshakeTimeout` {Number} Timeout in milliseconds for the handshake
271271
request. This is reset after every redirection.
272+
- `maxPayload` {Number} The maximum allowed message size in bytes.
272273
- `maxRedirects` {Number} The maximum number of redirects allowed. Defaults
273274
to 10.
274-
- `perMessageDeflate` {Boolean|Object} Enable/disable permessage-deflate.
275-
- `protocolVersion` {Number} Value of the `Sec-WebSocket-Version` header.
276275
- `origin` {String} Value of the `Origin` or `Sec-WebSocket-Origin` header
277276
depending on the `protocolVersion`.
278-
- `maxPayload` {Number} The maximum allowed message size in bytes.
277+
- `perMessageDeflate` {Boolean|Object} Enable/disable permessage-deflate.
278+
- `protocolVersion` {Number} Value of the `Sec-WebSocket-Version` header.
279279
- `skipUTF8Validation` {Boolean} Specifies whether or not to skip UTF-8
280280
validation for text and close messages. Defaults to `false`. Set to `true`
281281
only if the server is trusted.
@@ -491,14 +491,14 @@ only removes listeners added with
491491
- `data` {Array|Number|Object|String|ArrayBuffer|Buffer|DataView|TypedArray} The
492492
data to send.
493493
- `options` {Object}
494-
- `compress` {Boolean} Specifies whether `data` should be compressed or not.
495-
Defaults to `true` when permessage-deflate is enabled.
496494
- `binary` {Boolean} Specifies whether `data` should be sent as a binary or
497495
not. Default is autodetected.
498-
- `mask` {Boolean} Specifies whether `data` should be masked or not. Defaults
499-
to `true` when `websocket` is not a server client.
496+
- `compress` {Boolean} Specifies whether `data` should be compressed or not.
497+
Defaults to `true` when permessage-deflate is enabled.
500498
- `fin` {Boolean} Specifies whether `data` is the last fragment of a message
501499
or not. Defaults to `true`.
500+
- `mask` {Boolean} Specifies whether `data` should be masked or not. Defaults
501+
to `true` when `websocket` is not a server client.
502502
- `callback` {Function} An optional callback which is invoked when `data` is
503503
written out.
504504

lib/permessage-deflate.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ class PerMessageDeflate {
3030
* Creates a PerMessageDeflate instance.
3131
*
3232
* @param {Object} [options] Configuration options
33-
* @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
34-
* disabling of server context takeover
33+
* @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
34+
* for, or request, a custom client window size
3535
* @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
3636
* acknowledge disabling of client context takeover
37+
* @param {Number} [options.concurrencyLimit=10] The number of concurrent
38+
* calls to zlib
3739
* @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
3840
* use of a custom server window size
39-
* @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
40-
* for, or request, a custom client window size
41+
* @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
42+
* disabling of server context takeover
43+
* @param {Number} [options.threshold=1024] Size (in bytes) below which
44+
* messages should not be compressed
4145
* @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
4246
* deflate
4347
* @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
4448
* inflate
45-
* @param {Number} [options.threshold=1024] Size (in bytes) below which
46-
* messages should not be compressed
47-
* @param {Number} [options.concurrencyLimit=10] The number of concurrent
48-
* calls to zlib
4949
* @param {Boolean} [isServer=false] Create the instance in either server or
5050
* client mode
5151
* @param {Number} [maxPayload=0] The maximum allowed message length

lib/sender.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ class Sender {
4040
*
4141
* @param {Buffer} data The data to frame
4242
* @param {Object} options Options object
43-
* @param {Number} options.opcode The opcode
44-
* @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
45-
* modified
4643
* @param {Boolean} [options.fin=false] Specifies whether or not to set the
4744
* FIN bit
4845
* @param {Boolean} [options.mask=false] Specifies whether or not to mask
4946
* `data`
47+
* @param {Number} options.opcode The opcode
48+
* @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
49+
* modified
5050
* @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
5151
* RSV1 bit
5252
* @return {Buffer[]} The framed data as a list of `Buffer` instances
@@ -255,10 +255,10 @@ class Sender {
255255
*
256256
* @param {*} data The message to send
257257
* @param {Object} options Options object
258-
* @param {Boolean} [options.compress=false] Specifies whether or not to
259-
* compress `data`
260258
* @param {Boolean} [options.binary=false] Specifies whether `data` is binary
261259
* or text
260+
* @param {Boolean} [options.compress=false] Specifies whether or not to
261+
* compress `data`
262262
* @param {Boolean} [options.fin=false] Specifies whether the fragment is the
263263
* last one
264264
* @param {Boolean} [options.mask=false] Specifies whether or not to mask
@@ -321,12 +321,12 @@ class Sender {
321321
* `data`
322322
* @param {Object} options Options object
323323
* @param {Number} options.opcode The opcode
324-
* @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
325-
* modified
326324
* @param {Boolean} [options.fin=false] Specifies whether or not to set the
327325
* FIN bit
328326
* @param {Boolean} [options.mask=false] Specifies whether or not to mask
329327
* `data`
328+
* @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
329+
* modified
330330
* @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
331331
* RSV1 bit
332332
* @param {Function} [cb] Callback

lib/websocket.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,10 @@ class WebSocket extends EventEmitter {
378378
*
379379
* @param {*} data The message to send
380380
* @param {Object} [options] Options object
381-
* @param {Boolean} [options.compress] Specifies whether or not to compress
382-
* `data`
383381
* @param {Boolean} [options.binary] Specifies whether `data` is binary or
384382
* text
383+
* @param {Boolean} [options.compress] Specifies whether or not to compress
384+
* `data`
385385
* @param {Boolean} [options.fin=true] Specifies whether the fragment is the
386386
* last one
387387
* @param {Boolean} [options.mask] Specifies whether or not to mask `data`
@@ -565,20 +565,20 @@ module.exports = WebSocket;
565565
* @param {(String|URL)} address The URL to which to connect
566566
* @param {Array} protocols The subprotocols
567567
* @param {Object} [options] Connection options
568-
* @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable
569-
* permessage-deflate
568+
* @param {Boolean} [options.followRedirects=false] Whether or not to follow
569+
* redirects
570570
* @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
571571
* handshake request
572-
* @param {Number} [options.protocolVersion=13] Value of the
573-
* `Sec-WebSocket-Version` header
574-
* @param {String} [options.origin] Value of the `Origin` or
575-
* `Sec-WebSocket-Origin` header
576572
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
577573
* size
578-
* @param {Boolean} [options.followRedirects=false] Whether or not to follow
579-
* redirects
580574
* @param {Number} [options.maxRedirects=10] The maximum number of redirects
581575
* allowed
576+
* @param {String} [options.origin] Value of the `Origin` or
577+
* `Sec-WebSocket-Origin` header
578+
* @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable
579+
* permessage-deflate
580+
* @param {Number} [options.protocolVersion=13] Value of the
581+
* `Sec-WebSocket-Version` header
582582
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
583583
* not to skip UTF-8 validation for text and close messages
584584
* @private

0 commit comments

Comments
 (0)