New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sswahn/cookie

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sswahn/cookie

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

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-69.23%
Maintainers
1
Weekly downloads
 
Created
Source

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'

Retrieve a cookie by name.

const token = cookie.get('name')

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

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

Remove a cookie.

cookie.remove('name')
  • @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

Keywords

FAQs

Package last updated on 16 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc