Détail du package

tough-cookie-file-store

ivanmarban49.8kMIT3.2.1

A JSON file store for tough-cookie module

HTTP, cookie, cookies, set-cookie

readme

tough-cookie-file-store

NPM

A JSON file store implementation for tough-cookie module

Version npm npm Downloads Tests Status Coverage Status JavaScript Style Guide

Installation

$ npm install tough-cookie-file-store

Usage

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