# firefox-cookie

> Node Firefox Cookie Manager

Latest version **1.0.5** (published 2021-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install firefox-cookie
pnpm add firefox-cookie
yarn add firefox-cookie
bun add firefox-cookie
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-08-15 |
| First published | 2019-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Arshad Kazmi |
| Maintainers | arshadkazmi42 |
| Keywords | node, cookie-manager, firefox-cookie, firefox-cookie-manager, firefox, sqlite |

## Links

- npm: https://www.npmjs.com/package/firefox-cookie
- Repository: https://github.com/arshadkazmi42/firefox-cookie
- Homepage: https://github.com/arshadkazmi42/firefox-cookie#readme
- Issues: https://github.com/arshadkazmi42/firefox-cookie/issues
- npm.io page: https://npm.io/package/firefox-cookie

## Dependencies (3)

- [genql](https://npm.io/package/genql.md) ^1.0.4
- [sqlite3-promisify](https://npm.io/package/sqlite3-promisify.md) ^1.0.0
- [firefox-cookie-path](https://npm.io/package/firefox-cookie-path.md) ^1.0.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2021-08-15
- 1.0.4 — 2021-06-11
- 1.0.3 — 2021-06-11
- 1.0.2 — 2020-12-18
- 1.0.1 — 2019-08-25

## README

# firefox-cookie

[![Build](https://github.com/arshadkazmi42/firefox-cookie/actions/workflows/nodejs.yml/badge.svg)](https://github.com/arshadkazmi42/firefox-cookie/actions/workflows/nodejs.yml)

Node Cookie Manager for Firefox, read / write cookie from sqlite db

## Install

```
npm i firefox-cookie
```

## Usage

```javascript

// Search for the "default" profile in Firefox implicitly https://support.mozilla.org/gl/questions/1264072
const FirefoxCookie = require('firefox-cookie');
const FFCookie = new FirefoxCookie();

// Search for the "default-release" new profile in Firefox explicitly (or any other profile you give as parameter)
const FirefoxCookie = require('firefox-cookie');
const FFCookie = new FirefoxCookie("default-release");

// Reading cookie
const cookie = await FFCookie.getCookie('arshad.com');

// Inserting cookie
const DATA = [
  {
    'baseDomain': 'arshad.com',
    'originAttributes': '',
    'name': 'arshad',
    'value': 'arshad-test-cookie',
    'host': 'arshad.com',
    'path': '/root',
    'expiry': 1,
    'lastAccessed': 111111111,
    'creationTime': 10001110,
    'isSecure': 1,
    'isHttpOnly': 0,
    'inBrowserElement': 0,
    'sameSite': 0,
  }
];

await FFCookie.setCookie(DATA);
```

## API

- **`getCookie(path)`**
  - Returns cookie json from database for the input path
    - **Params**
      - path (String)

- **`setCookie(cookies)`**
  - Adds all the input cookies into the sqlite database
    - **Params**
      - cookies (Array of cookies object)

- **`removeCookie(domain)`**
  - Removes all records matching the domain.
  - > It uses `like` condition (`%domain%`) so anything matching the pattern will be removed
    - **Params**
      - path (String)

## Contributing

Interested in contributing to this project?
You can log any issues or suggestion related to this library [here](https://github.com/arshadkazmi42/firefox-cookie/issues/new)

Read our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase

## Contributors

Thank you to all the contributors who have helped us in making this project better :raised_hands:

<a href="https://github.com/arshadkazmi42"><img src="https://github.com/arshadkazmi42.png" width="30" /></a>

---
_Source: https://npm.io/package/firefox-cookie · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
