1.0.0 • Published 7 months ago

@nodecfdi/tough-cookie-file-store v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@nodecfdi/tough-cookie-file-store

Source Code Npm Node Version Support Discord Latest Version Software License Build Status Reliability Maintainability Code Coverage Violations Total Downloads

A JSON file store implementation for tough-cookie module.

!WARNING This package is native ESM and no longer provides a CommonJS export. If your project uses CommonJS, you will have to convert to ESM. Please don't open issues for questions regarding CommonJS / ESM.

About of @nodecfdi/tough-cookie-file-store

A JSON file store implementation for tough-cookie module

Installation

NPM

npm install @nodecfdi/tough-cookie-file-store

YARN

yarn add @nodecfdi/tough-cookie-file-store

PNPM

pnpm add @nodecfdi/tough-cookie-file-store

Usage

import { FileCookieStore } from '@nodecfdi/tough-cookie-file-store';
import { CookieJar, Cookie } from 'tough-cookie';

const cookieJar = new CookieJar(new FileCookieStore('cookies.json'));

const cookie = Cookie.parse('foo=bar; Domain=example.com; Path=/');
await cookieJar.setCookie(cookie, 'https://example.com');

Contributing

Contributions are welcome. Please read CONTRIBUTING for more details and remember to review the CHANGELOG.

Copyright and License

The @nodecfdi/tough-cookie-file-store library is copyright © NodeCfdi and licensed for use under the MIT License (MIT). Please see LICENSE for more information.