https://github.com/ivanmarban/tough-cookie-file-store
A JSON file store implementation for tough-cookie module
https://github.com/ivanmarban/tough-cookie-file-store
cookie cookiestorage node node-js toughcookie-json
Last synced: about 1 month ago
JSON representation
A JSON file store implementation for tough-cookie module
- Host: GitHub
- URL: https://github.com/ivanmarban/tough-cookie-file-store
- Owner: ivanmarban
- License: mit
- Created: 2016-02-10T21:40:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-04-20T19:34:26.000Z (about 1 month ago)
- Last Synced: 2025-04-20T20:23:47.347Z (about 1 month ago)
- Topics: cookie, cookiestorage, node, node-js, toughcookie-json
- Language: JavaScript
- Homepage:
- Size: 527 KB
- Stars: 21
- Watchers: 2
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tough-cookie-file-store
[](https://nodei.co/npm/tough-cookie-file-store/)
A JSON file store implementation for [tough-cookie][0] module
[](https://www.npmjs.com/package/tough-cookie-file-store)
[](https://npmcharts.com/compare/tough-cookie-file-store?minimal=true)
[](https://github.com/ivanmarban/tough-cookie-file-store/actions/workflows/tests.yml)
[](https://coveralls.io/github/ivanmarban/tough-cookie-file-store?branch=master)
[](https://standardjs.com)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4DELQKMDMDQY4)## Installation
``` sh
$ npm install tough-cookie-file-store
```## Usage
``` js
import { CookieJar, Cookie } from 'tough-cookie'
import FileCookieStore from 'tough-cookie-file-store'
const cookieJar = new CookieJar(new FileCookieStore('./cookie.json'))
const cookie = Cookie.parse('foo=bar; Domain=example.com; Path=/')
cookieJar.setCookie(cookie, 'http://example.com', function (error, cookie) {
console.log(cookie)
})
```## License
MIT[0]: https://github.com/salesforce/tough-cookie