Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mozmeao/cookie-helper

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mozmeao/cookie-helper

A complete cookies reader/writer framework with full unicode support.

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
246
increased by13.89%
Maintainers
5
Weekly downloads
 
Created
Source

What does it do?

A complete cookies reader/writer framework with full unicode support. For more general information on web Cookies visit MDN.

How to install and use

Install via npm: npm install @mozmeao/cookie-helper

Import the library at your applications entrypoint via require, import or by using a global variable in your script tag::

  • import CookieHelper from '@mozmeao/cookie-helper';
  • const CookieHelper = require('@mozmeao/cookie-helper')
  • const CookieHelper = window.CookieHelper

Once that object is instanciated you can use the following functions:

FunctionNotes
CookieHelper.setItem(name, value[, end[, path[, domain[, secure[, samesite]]]]])will set a cookie inside of document.cookie If the cookie is created it will return true otherwise, false
CookieHelper.getItem(name)Will return the key that you pass to the function, if not found or no argument was passed - will return null
CookieHelper.removeItem(name[, path[, domain]])Will remove the cookie that matches the passed key. If no key is found, it will return false. If key is found, it will set the cookie to expire immediately and then return true
CookieHelper.hasItem(name)Will return true if cookie is found that matches the passed key. If no key is found it will return false
CookieHelper.keys()Will return an array of the keys found in document.cookie

Further Doumentation

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.

Keywords

FAQs

Package last updated on 28 Jun 2022

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