mirror of
https://github.com/hanzoai/cookie.git
synced 2026-09-24 16:58:00 +00:00
Remove deprecations from README (#279)
This commit is contained in:
@@ -16,14 +16,11 @@ $ npm install cookie
|
||||
## API
|
||||
|
||||
```js
|
||||
const cookie = require("cookie");
|
||||
// import * as cookie from 'cookie';
|
||||
import * as cookie from "cookie";
|
||||
```
|
||||
|
||||
### cookie.parseCookie(str, options)
|
||||
|
||||
Alias: `parse(str, options)` ([deprecated](#deprecated))
|
||||
|
||||
Parse an HTTP `Cookie` header string and return an [object](#cookie-object) of all cookie name-value pairs.
|
||||
The `str` argument is the string representing a `Cookie` header value and `options` is an
|
||||
optional object containing additional parsing options.
|
||||
@@ -74,8 +71,6 @@ cookie.parseSetCookie(
|
||||
|
||||
### cookie.stringifySetCookie(setCookieObj, options)
|
||||
|
||||
Alias: `serialize(str, val, options)` ([deprecated](#deprecated))
|
||||
|
||||
Stringifies a [`Set-Cookie` object](#set-cookie-object) into a `Set-Cookie` header string.
|
||||
|
||||
```js
|
||||
@@ -243,14 +238,6 @@ function onRequest(req, res) {
|
||||
http.createServer(onRequest).listen(3000);
|
||||
```
|
||||
|
||||
## Deprecated
|
||||
|
||||
These APIs will be removed in the future:
|
||||
|
||||
- `parse` - use new `parseCookie` name
|
||||
- `stringify` - use new `stringifySetCookie` name
|
||||
- `stringify(str, val, opts)` - use `stringifySetCookie(obj, opts)`
|
||||
|
||||
## Testing
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user