Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vanruesc/kukki
A simple cookie manager.
https://github.com/vanruesc/kukki
browser client cookie manager map static
Last synced: 19 days ago
JSON representation
A simple cookie manager.
- Host: GitHub
- URL: https://github.com/vanruesc/kukki
- Owner: vanruesc
- License: zlib
- Created: 2018-06-25T22:38:25.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2021-03-01T17:55:55.000Z (over 3 years ago)
- Last Synced: 2024-05-02T05:14:59.678Z (7 months ago)
- Topics: browser, client, cookie, manager, map, static
- Language: TypeScript
- Homepage:
- Size: 313 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Kukki
[![CI](https://badgen.net/github/checks/vanruesc/kukki/main)](https://github.com/vanruesc/kukki/actions)
[![Version](https://badgen.net/npm/v/kukki?color=green)](https://www.npmjs.com/package/kukki)
[![Dependencies](https://badgen.net/david/dep/vanruesc/kukki)](https://david-dm.org/vanruesc/kukki)A static cookie manager that behaves like a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map).
*[Documentation](https://vanruesc.github.io/kukki)*
## Installation
```sh
npm install kukki
```## Usage
```javascript
import { Kukki } from "kukki";// Create a new cookie.
Kukki.set("key", "value");
Kukki.get("key"); // => "value"// Create a persistent cookie.
const date = new Date();
date.setFullYear(date.getFullYear() + 2);
Kukki.set("persistentCookie", "persistentValue", { expires: date });
```## Contributing
Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.