1.0.4 • Published 2 months ago

@andrewcaires/cookie v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

npm downloads size license

Cookie

Plugin for HTTP cookie

Installation

npm i @andrewcaires/cookie

Usage

import Cookie from '@andrewcaires/cookie';

Cookie.options({
  domain: '',
  expires: 86400, // value in milliseconds
  path: '/',
  secure: false,
});

Api

  • all Get all cookies
const cookies = Cookie.all();
  • check Check if a cookie exists
const exists = Cookie.check('token');
  • get Get a cookie
const token = Cookie.get('token');
  • remove Remove a cookie
Cookie.remove('token');
  • set Set a cookie
Cookie.set('token', '...');

Cookie.set('token', '...', {
  domain: '',
  expires: 86400,
  path: '/',
  secure: false,
});

Links

License

1.0.4

2 months ago

1.0.3

5 months ago

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago