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

simple-cookies

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-cookies

A very simple JS (or TS) library to handle cookies in the browser

latest
Source
npmnpm
Version
0.6.0
Version published
Maintainers
1
Created
Source

A very simple utility library for handling cookies in client code (JS or TS)

Build Status License: MIT DevDependency Status Coverage Status npm npm

Install

yarn add simple-cookies

OR

npm install simple-cookies

How to use

import cookies from 'simple-cookies';

cookies.set('example', 'value' /*, cookieOpts (see below) */); // Return true if cookies are supported
cookies.get('example' /*, cookieOpts (see below) */); // Returns 'value' if cookies are supported
cookies.remove('example' /*, cookieOpts (see below) */); // Returns true if cookies are supported

Options

For each cookie-method you can pass an optional last argument that is an object with any of the following properties and values:

NameValuesEffect
silenttruefalse (default)
daysa numberHow long the cookies should be valid (in days) optional
securetruefalse (default)
patha stringIndicates the URL in which the cookie is used
domaina stringThe host(s) to whom the cookie will be sent to

License

All of the code is licensed under the MIT license

FAQs

Package last updated on 29 Jun 2017

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