npm package: @nodecfdi/tough-cookie-file-store
Description: A JSON file store implementation for tough-cookie module
Author: Fernando Isidro
Latest version: 1.0.0

# `@nodecfdi/tough-cookie-file-store`

[![Source Code][badge-source]][source]
[![Npm Node Version Support][badge-node-version]][node-version]
[![Discord][badge-discord]][discord]
[![Latest Version][badge-release]][release]
[![Software License][badge-license]][license]
[![Build Status][badge-build]][build]
[![Reliability][badge-reliability]][reliability]
[![Maintainability][badge-maintainability]][maintainability]
[![Code Coverage][badge-coverage]][coverage]
[![Violations][badge-violations]][violations]
[![Total Downloads][badge-downloads]][downloads]

> A JSON file store implementation for tough-cookie module.

> [!WARNING]
> This package is native [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and no longer provides a CommonJS export. If your project uses CommonJS, you will have to [convert to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). 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](https://github.com/salesforce/tough-cookie) module

## Installation

NPM

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

YARN

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

PNPM

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

## Usage

```ts
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](https://github.com/nodecfdi) and licensed for use under the MIT License (MIT). Please see [LICENSE][] for more information.

[contributing]: https://github.com/nodecfdi/.github/blob/main/docs/CONTRIBUTING.md
[changelog]: https://github.com/nodecfdi/tough-cookie-file-store/blob/main/CHANGELOG.md
[source]: https://github.com/nodecfdi/tough-cookie-file-store
[node-version]: https://www.npmjs.com/package/@nodecfdi/tough-cookie-file-store
[discord]: https://discord.gg/AsqX8fkW2k
[release]: https://www.npmjs.com/package/@nodecfdi/tough-cookie-file-store
[license]: https://github.com/nodecfdi/tough-cookie-file-store/blob/main/LICENSE.md
[build]: https://github.com/nodecfdi/tough-cookie-file-store/actions/workflows/build.yml?query=branch:main
[reliability]: https://sonarcloud.io/component_measures?id=nodecfdi_tough-cookie-file-store&metric=Reliability
[maintainability]: https://sonarcloud.io/component_measures?id=nodecfdi_tough-cookie-file-store&metric=Maintainability
[coverage]: https://sonarcloud.io/component_measures?id=nodecfdi_tough-cookie-file-store&metric=Coverage
[violations]: https://sonarcloud.io/project/issues?id=nodecfdi_tough-cookie-file-store&resolved=false
[downloads]: https://www.npmjs.com/package/@nodecfdi/tough-cookie-file-store
[badge-source]: https://img.shields.io/badge/source-nodecfdi/tough--cookie--file--store-blue.svg?logo=github
[badge-node-version]: https://img.shields.io/node/v/@nodecfdi/tough-cookie-file-store.svg?logo=nodedotjs
[badge-discord]: https://img.shields.io/discord/459860554090283019?logo=discord
[badge-release]: https://img.shields.io/npm/v/@nodecfdi/tough-cookie-file-store.svg?logo=npm
[badge-license]: https://img.shields.io/github/license/nodecfdi/tough-cookie-file-store.svg?logo=open-source-initiative
[badge-build]: https://img.shields.io/github/actions/workflow/status/nodecfdi/tough-cookie-file-store/build.yml?branch=main&logo=github-actions
[badge-reliability]: https://sonarcloud.io/api/project_badges/measure?project=nodecfdi_tough-cookie-file-store&metric=reliability_rating
[badge-maintainability]: https://sonarcloud.io/api/project_badges/measure?project=nodecfdi_tough-cookie-file-store&metric=sqale_rating
[badge-coverage]: https://img.shields.io/sonar/coverage/nodecfdi_tough-cookie-file-store/main?logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
[badge-violations]: https://img.shields.io/sonar/violations/nodecfdi_tough-cookie-file-store/main?format=long&logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io
[badge-downloads]: https://img.shields.io/npm/dm/@nodecfdi/tough-cookie-file-store.svg?logo=npm