Socket
Socket
Sign inDemoInstall

@types/cookiejar

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/cookiejar

TypeScript definitions for cookiejar


Version published
Maintainers
1
Created

What is @types/cookiejar?

@types/cookiejar provides TypeScript type definitions for the cookiejar library, which is used for handling HTTP cookies in a Node.js environment.

What are @types/cookiejar's main functionalities?

Creating a Cookie

This feature allows you to create a new Cookie object from a string. The Cookie object can then be used to inspect or manipulate the cookie's properties.

const { Cookie } = require('cookiejar');
const cookie = new Cookie('key=value; domain=example.com; path=/;');
console.log(cookie);

Creating a CookieJar

This feature allows you to create a new CookieJar object, which is a collection of cookies. The CookieJar can be used to store and retrieve cookies.

const { CookieJar } = require('cookiejar');
const jar = new CookieJar();
console.log(jar);

Adding a Cookie to a CookieJar

This feature allows you to add a Cookie object to a CookieJar. The CookieJar can then be used to manage multiple cookies.

const { Cookie, CookieJar } = require('cookiejar');
const jar = new CookieJar();
const cookie = new Cookie('key=value; domain=example.com; path=/;');
jar.setCookie(cookie);
console.log(jar);

Retrieving a Cookie from a CookieJar

This feature allows you to retrieve a specific cookie from a CookieJar based on the cookie's key, domain, and path.

const { Cookie, CookieJar } = require('cookiejar');
const jar = new CookieJar();
const cookie = new Cookie('key=value; domain=example.com; path=/;');
jar.setCookie(cookie);
const retrievedCookie = jar.getCookie('key', 'example.com', '/');
console.log(retrievedCookie);

Other packages similar to @types/cookiejar

FAQs

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