https://github.com/vanruesc/kukki
A simple cookie manager.
https://github.com/vanruesc/kukki
browser client cookie manager map static
Last synced: about 1 year 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 (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2021-03-01T17:55:55.000Z (over 5 years ago)
- Last Synced: 2024-10-29T20:11:29.509Z (over 1 year 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
[](https://github.com/vanruesc/kukki/actions)
[](https://www.npmjs.com/package/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.