New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@stein197/cookie

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stein197/cookie

Tiny JavaScript cookie library

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

This tiny library provides a simple way for managing cookies in a browser.

Installation

npm install @stein197/cookie

Usage

import Cookie from "@stein197/cookie";

const cookie = new Cookie(document);
cookie.get("key");                       // Return a value denoted by a key
cookie.get();                            // Return all cookies
cookie.set("key", "value", {path: "/"}); // Set a single value
cookie.set({key: "value"});              // Set multiple values
cookie.has("key");                       // Returns true if there is a value associated with the key
cookie.unset("key");                     // Remove an entry by a key
cookie.clear();                          // Remove all entries
cookie.parse("key=value");               // Parse cookie string
cookie.stringify({key: "value"});        // Stringify an object
// ...

API

Refer to the source code for the documentation, please

NPM scripts

  • clean Deletes compiled files
  • test Runs unit tests
  • build Builds the project

Keywords

cookie

FAQs

Package last updated on 30 Apr 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