1.0.2 • Published 6 months ago

@sswahn/cookie v1.0.2

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

Cookie · License npm version Weekly Downloads

A lightweight, easy-to-use utility for efficiently managing cookies in a web browser.

Features

  • Get Cookie: Retrieve the value of a cookie.
  • Set Cookie: Set a cookie with optional attributes.
  • Remove Cookie: Easily delete a cookie.

Installation

Using npm.

npm install @sswahn/cookie

Usage

Import library.

import cookie from '@sswahn/cookie'

Get Cookie

Retrieve a cookie by name.

const token = cookie.get('name')

Set Cookie

Set a cookie, with optional expiration argument (a numeric value representing the lifetime of the cookie in seconds).

cookie.set('name', value, expiration)

Remove Cookie

Remove a cookie.

cookie.remove('name')

Related

  • @sswahn/storage: A robust and easy-to-use utility for interacting with Web Storage API.
  • @sswahn/database: Easily interact with the IndexedDB API with a simplified, promise-based approach.
  • @sswahn/cache: A robust caching utility that provides easy-to-use methods for interacting with the browser's Cache API.

License

Cookie is MIT Licensed

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago

1.0.0-beta.4

6 months ago

1.0.0-beta.3

7 months ago

1.0.0-beta.2

7 months ago

1.0.0-beta.1

7 months ago

1.0.0-beta.0

7 months ago