Readplace

js-cookie

npm 6 min read
View original
Summary (TL;DR)
js-cookie is a lightweight JavaScript library (under 800 bytes gzipped) for handling cookies client-side, with broad browser support, no dependencies, and RFC 6265 compliance. It supports setting, reading, and deleting cookies with attributes like expires, path, domain, secure, sameSite, and partitioned. Global defaults can be set via withAttributes(), and custom encoding/decoding via withConverter(). The library offers ES and UMD modules, plus a TypeScript types package.