Skip to content

Commit

Permalink
Simplify CookieJar docs (#2155)
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi authored Oct 4, 2022
1 parent 07afa3c commit 623229f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions documentation/2-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,14 +649,12 @@ console.log(instance.defaults.options.context);
Cookie support. Handles parsing and storing automatically.

```js
import {promisify} from 'util';
import got from 'got';
import {CookieJar} from 'tough-cookie';

const cookieJar = new CookieJar();
const setCookie = promisify(cookieJar.setCookie.bind(cookieJar));

await setCookie('foo=bar', 'https://example.com');
await cookieJar.setCookie('foo=bar', 'https://example.com');
await got('https://example.com', {cookieJar});
```

Expand Down

0 comments on commit 623229f

Please sign in to comment.