tough-cookie-file-store
v2.0.3
Published
A JSON file store for tough-cookie module
Downloads
31,688
Maintainers
Readme
tough-cookie-file-store
A JSON file store implementation for tough-cookie module
Installation
$ npm install tough-cookie-file-store
Usage
const { CookieJar, Cookie } = require('tough-cookie')
const CookieFileStore = require('tough-cookie-file-store').FileCookieStore
const cookieJar = new CookieJar(new CookieFileStore('./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