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

@yurkimus/cookies

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yurkimus/cookies

JavaScript-utilities to handle cookies everywhere.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Cookies

JavaScript-utilities to handle cookies everywhere.

Table of Contents

  • Installation
  • Exports
  • License

Installation

npm

npm install @yurkimus/cookies

urls

"@yurkimus/cookies": "npm:@yurkimus/cookies"
"@yurkimus/cookies": "github:yurkimus/cookies"
"@yurkimus/cookies": "https://raw.githubusercontent.com/yurkimus/cookies/main/source/index.js"

Exports

parseCookie

Definition
parseCookie :: string -> *
Example
parseCookie('name=John; age=30; role=admin') // => [['name', 'John'], ['age', '30'], ['role', 'admin']]

readCookie

Definition
readCookie :: * -> string -> *
Example
let cookie = 'name=John; age=30; role=admin'

readCookie('age', cookie) // => '30'

readCookie(['age', 'name'], cookie) // => ['30', 'John']

serializeCookie

Definition
serializeCookie :: string -> * -> [(string, string)] -> string
Example
let attributes = [
  ['path', '/'],
  ['expires', 'Wed, 21 Oct 2026 07:28:00 GMT'],
]

serializeCookie('name', 'John', attributes) // => 'name=John; path=/; expires=Wed, 21 Oct 2026 07:28:00 GMT'

License

MIT

FAQs

Package last updated on 15 Aug 2024

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