Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/conedevelopment/qkie
Simple cookie management.
https://github.com/conedevelopment/qkie
cookie
Last synced: about 2 months ago
JSON representation
Simple cookie management.
- Host: GitHub
- URL: https://github.com/conedevelopment/qkie
- Owner: conedevelopment
- License: mit
- Created: 2023-08-18T09:01:55.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-28T11:56:20.000Z (4 months ago)
- Last Synced: 2024-10-31T17:35:29.381Z (2 months ago)
- Topics: cookie
- Language: JavaScript
- Homepage: https://conedevelopment.com
- Size: 16.6 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');
```