auchenberg / tough-cookie-file-store

A JSON file store implementation for tough-cookie module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tough-cookie-file-store

NPM

A JSON file store implementation for tough-cookie module

Version npm npm Downloads Build Status Coverage Status dependencies Status JavaScript Style Guide Donate

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

About

A JSON file store implementation for tough-cookie module

License:MIT License


Languages

Language:JavaScript 100.0%