https://github.com/arshadkazmi42/chrome-cookie
Chrome cookie manager for node. To set and get cookie from chrome
https://github.com/arshadkazmi42/chrome-cookie
chrome chrome-cookie cookie cookie-crud crud db hacktoberfest sql sqlite
Last synced: about 1 year ago
JSON representation
Chrome cookie manager for node. To set and get cookie from chrome
- Host: GitHub
- URL: https://github.com/arshadkazmi42/chrome-cookie
- Owner: arshadkazmi42
- License: mit
- Created: 2019-08-04T09:01:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-03T18:14:01.000Z (over 3 years ago)
- Last Synced: 2024-05-01T14:35:49.730Z (almost 2 years ago)
- Topics: chrome, chrome-cookie, cookie, cookie-crud, crud, db, hacktoberfest, sql, sqlite
- Language: JavaScript
- Homepage:
- Size: 147 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# chrome-cookie
[](https://github.com/arshadkazmi42/chrome-cookie/actions/workflows/nodejs.yml)
[](https://www.npmjs.com/package/chrome-cookie)
[](https://www.npmjs.com/package/chrome-cookie)
[](https://github.com/arshadkazmi42/chrome-cookie)
[](https://github.com/arshadkazmi42/chrome-cookie/blob/master/LICENSE)
[](https://github.com/arshadkazmi42/chrome-cookie/graphs/contributors)
[](https://github.com/arshadkazmi42/chrome-cookie/commits/master)
Node Cookie Manager for Chrome, read / write cookie from sqlite db
## Install
```
npm i chrome-cookie
```
## Usage
```javascript
const ChromeCookie = require('chrome-cookie');
const CCookie = new ChromeCookie();
// Reading cookie
const cookie = await CCookie.getCookie('arshad.com');
// Inserting cookie
const DATA = [
{
'creation_utc': 'now',
'encrypted_value': 'enc2',
'expires_utc': 'never',
'has_expires': 'yes',
'host_key': 'arshad.com',
'is_httponly': 'yes',
'is_persistent': 'no',
'is_secure': 'yes',
'last_access_utc': 'now',
'name': 'arshad',
'path': '/root',
'priority': 'no',
'value': 'kazmi',
'samesite': -1
}
];
await CCookie.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/chrome-cookie/issues/new)
Read our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase