Skip to content

Commit 43dde8f

Browse files
committed
docs: hard wrap lines
1 parent 0ec7045 commit 43dde8f

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

Diff for: README.md

+28-11
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
[![Build Status][travis-image]][travis-url]
66
[![Test Coverage][coveralls-image]][coveralls-url]
77

8-
Parse `Cookie` header and populate `req.cookies` with an object keyed by the cookie
9-
names. Optionally you may enable signed cookie support by passing a `secret` string,
10-
which assigns `req.secret` so it may be used by other middleware.
8+
Parse `Cookie` header and populate `req.cookies` with an object keyed by the
9+
cookie names. Optionally you may enable signed cookie support by passing a
10+
`secret` string, which assigns `req.secret` so it may be used by other
11+
middleware.
1112

1213
## Installation
1314

@@ -27,29 +28,45 @@ app.use(cookieParser())
2728

2829
### cookieParser(secret, options)
2930

30-
- `secret` a string or array used for signing cookies. This is optional and if not specified, will not parse signed cookies. If a string is provided, this is used as the secret. If an array is provided, an attempt will be made to unsign the cookie with each secret in order.
31-
- `options` an object that is passed to `cookie.parse` as the second option. See [cookie](https://www.npmjs.org/package/cookie) for more information.
31+
- `secret` a string or array used for signing cookies. This is optional and if
32+
not specified, will not parse signed cookies. If a string is provided, this
33+
is used as the secret. If an array is provided, an attempt will be made to
34+
unsign the cookie with each secret in order.
35+
- `options` an object that is passed to `cookie.parse` as the second option. Se
36+
[cookie](https://www.npmjs.org/package/cookie) for more information.
3237
- `decode` a function to decode the value of the cookie
3338

3439
### cookieParser.JSONCookie(str)
3540

36-
Parse a cookie value as a JSON cookie. This will return the parsed JSON value if it was a JSON cookie, otherwise, it will return the passed value.
41+
Parse a cookie value as a JSON cookie. This will return the parsed JSON value
42+
if it was a JSON cookie, otherwise, it will return the passed value.
3743

3844
### cookieParser.JSONCookies(cookies)
3945

40-
Given an object, this will iterate over the keys and call `JSONCookie` on each value, replacing the original value with the parsed value. This returns the same object that was passed in.
46+
Given an object, this will iterate over the keys and call `JSONCookie` on each
47+
value, replacing the original value with the parsed value. This returns the
48+
same object that was passed in.
4149

4250
### cookieParser.signedCookie(str, secret)
4351

44-
Parse a cookie value as a signed cookie. This will return the parsed unsigned value if it was a signed cookie and the signature was valid. If the value was not signed, the original value is returned. If the value was signed but the signature could not be validated, `false` is returned.
52+
Parse a cookie value as a signed cookie. This will return the parsed unsigned
53+
value if it was a signed cookie and the signature was valid. If the value was
54+
not signed, the original value is returned. If the value was signed but the
55+
signature could not be validated, `false` is returned.
4556

46-
The `secret` argument can be an array or string. If a string is provided, this is used as the secret. If an array is provided, an attempt will be made to unsign the cookie with each secret in order.
57+
The `secret` argument can be an array or string. If a string is provided, this
58+
is used as the secret. If an array is provided, an attempt will be made to
59+
unsign the cookie with each secret in order.
4760

4861
### cookieParser.signedCookies(cookies, secret)
4962

50-
Given an object, this will iterate over the keys and check if any value is a signed cookie. If it is a signed cookie and the signature is valid, the key will be deleted from the object and added to the new object that is returned.
63+
Given an object, this will iterate over the keys and check if any value is a
64+
signed cookie. If it is a signed cookie and the signature is valid, the key
65+
will be deleted from the object and added to the new object that is returned.
5166

52-
The `secret` argument can be an array or string. If a string is provided, this is used as the secret. If an array is provided, an attempt will be made to unsign the cookie with each secret in order.
67+
The `secret` argument can be an array or string. If a string is provided, this
68+
is used as the secret. If an array is provided, an attempt will be made to
69+
unsign the cookie with each secret in order.
5370

5471
## Example
5572

0 commit comments

Comments
 (0)