https://github.com/conedevelopment/qkie
qkie is a simple and lightweight JavaScript package for managing cookies in the browser.
https://github.com/conedevelopment/qkie
cookie javascript javascript-library
Last synced: 11 months ago
JSON representation
qkie is a simple and lightweight JavaScript package for managing cookies in the browser.
- Host: GitHub
- URL: https://github.com/conedevelopment/qkie
- Owner: conedevelopment
- License: mit
- Created: 2023-08-18T09:01:55.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-20T08:34:21.000Z (about 1 year ago)
- Last Synced: 2025-04-01T12:49:14.713Z (12 months ago)
- Topics: cookie, javascript, javascript-library
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qkie - Simple cookie management
## Installation
```sh
npm install @conedevelopment/qkie
# or
yarn add @conedevelopment/qkie
```
## Usage
```js
import Cookie from '@conedevelopment/qkie';
const handler = new Cookie();
```
### Writing Cookies
```js
handler.set('theme', 'dark');
// Passing extra options
handler.set('theme', 'dark', new Date('2024-10-10'), '/', {
SameSite: 'Lax',
Secure: true,
});
```
### Reading Cookies
```js
let theme = handler.get('theme');
// With default value
let theme = handler.get('theme', 'dark');
```
### Checking Cookies
```js
if (handler.isset('theme')) {
//
}
```
### Deleting Cookies
```js
handler.remove('theme');
```