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

1.1.0 • Public • Published

cookiemonster

Client-side cookie handling.

Use like:

import {CookieMonster} from 'cookiemonster';
var cookies = new CookieMonster(document);
var one_month_from_now = new Date(new Date().getTime() + 31*24*60*60*1000);
cookies.set('screen_name', 'chbrown', {path: '/', expires: one_month_from_now});
cookies.get('screen_name');

API

  • CookieMonster#get(name: string): string

    Get the string value of the cookie named name.

  • CookieMonster#set(name: string, value: string, options: CookieOptions): string

    Set the string value of the cookie named name with the given options.

  • CookieMonster#del(name: string, options: CookieOptions): string:

    Expire the cookie named name; set its value to the empty string and expires to the UNIX epoch.

License

Copyright 2012-2015 Christopher Brown. MIT Licensed.

Package Sidebar

Install

npm i cookiemonster

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • chbrown