Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whosydd/cookie-format
format cookie for lib
https://github.com/whosydd/cookie-format
cookie format puppeteer
Last synced: about 4 hours ago
JSON representation
format cookie for lib
- Host: GitHub
- URL: https://github.com/whosydd/cookie-format
- Owner: whosydd
- License: mit
- Created: 2021-10-12T18:49:36.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-05T17:41:52.000Z (about 3 years ago)
- Last Synced: 2024-11-18T16:30:51.695Z (1 day ago)
- Topics: cookie, format, puppeteer
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cookie-format
一个简单的工具库,用于处理各种 cookie 格式化,目前仅添加了处理`puppeteer`的 cookie 格式,后续用到时会继续添加对其他库的支持
## Usage
```js
const { puppeteerCookie } = require('cookie-format')// puppeteerCookie接收的第一个参数为cookie字符串,第二个参数为其他参数的对象,例如:domain、url等
const res = puppeteerCookie('a=1; b=2', { domain: 'example.com' })//puppeteer中设置cookie
await page.setCookie(...res)
```