baked-cookies
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Baked Cookies

npm version

Pure JS library to parse and serialize cookie strings for further manipulation

Install

Using npm:

npm install --save baked-cookies

Using yarn:

$ yarn add baked-cookies

Usage

In this example we are parsing cookie string. As result we are getting object of key-value pairs with cookies data.

import { parse } from 'baked-cookies';

const parseResult = parse('cookieKey=cookieValue;'); // parseResult = {cookieKey: 'cookieValue'}

Here we are serializing object of key-value pair into cookie string.

import { serialize } from 'baked-cookies';

const serializeResult = serialize({cookieKey: 'cookieValue'}); // serializeResult = 'cookieKey=cookieValue;'

License

Baked Cookies is released under the MIT license.

Package Sidebar

Install

npm i baked-cookies

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

10.7 kB

Total Files

9

Last publish

Collaborators

  • dmytro.baida