A simple, lightweight JavaScript API for handling cookies
- Works in all browsers
- Accepts any character
- Heavily tested
- No dependency
- Supports ES modules
- Supports AMD/CommonJS
- RFC 6265 compliant
- Useful Wiki
- Enable custom encoding/decoding
- < 800 bytes gzipped!
👉👉 If you're viewing this at https://github.com/js-cookie/js-cookie, you're reading the documentation for the master branch. View documentation for the latest release. 👈👈
JavaScript Cookie supports npm under the name js-cookie
.
$ npm i js-cookie
The npm package has a module
field pointing to an ES module variant of the library, mainly to provide support for ES module aware bundlers, whereas its browser
field points to an UMD module for full backward compatibility.