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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

v3.2.1 - 2025-07-03

Fixed

  • #26 Fix issue when importing from non-module

v3.2.0 - 2025-06-27

Added

  • #24 Add fileFormat option, support for loading cookies.txt

v3.1.0 - 2025-06-23

Changed

  • #23 Add support for async fs operations, merge types into typescript file

v3.0.2 - 2025-06-06

Added

  • Built-in typescript types

v3.0.1 - 2025-04-26

Fix

  • #21 Use explicit extension to address Node error

v3.0.0 - 2025-04-20

Added

  • tough-cookie@5 support.

v2.0.3 - 2020-09-28

Changed

  • Replaced Travis CI by GitHub Actions

v2.0.2 - 2020-05-16

Fixed

  • #9 missed inspect rename from b27a42bc

v2.0.1 - 2020-05-05

Fixed

  • #7 findCookies is incompatible with tough-cookie 4

v2.0.0 - 2020-05-03

Added

  • tough-cookie@4 support.
  • Code style: ESLint + Standard + Prettier.
  • Test coverage.
  • JSDoc documentation.

Changed

  • Refactored module.

Removed

  • Removed isEmtpy() and isExpired() methods in favor of pure implementation of Store class.

v1.2.0 - 2016-08-09

Added

  • Added getAllCookies() method.

Changed

  • Updated tough-cookie dependency.

Fixed

  • Avoid redundant fs.writeFile() operations on same file.

v1.1.1 - 2016-08-09

Changed

  • Updated tough-cookie dependency.

v1.1.0 - 2016-02-10

Added

  • Added isEmpty() method.

v1.0.0 - 2016-02-10

  • Initial version.