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

cookie-api-handler

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cookie-api-handler

Handler for cookie APIs

  • 2.25.15
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-58.33%
Maintainers
1
Weekly downloads
 
Created
Source

npm version renovate-app Known Vulnerabilities codecov travis

Extension of rest-api-handler library. It parse cookies from response headers and use them to send requests.

Library is compiled for node 9.6 and include Fetch polyfill.

How to use it

Install the library:

npm install cookie-api-handler

Send requests:

const CookieApi = require('cookie-api-handler');

(async () => {
    const api = new CookieApi('');

    await api.get('https://endomondo.com');

    console.log(api.getCookies());
})();

For more information about sending requests, check base library.

How to work with cookies

Cookies are inserted to object based on response headers. Class have methods to add custom cookies and read the current ones:

// will return object of decoded strings
api.getCookies();


// you can add custom cookies, string only. Cookies will be encoded.
api.addCookies({
    cookieName: 'cookieValue',
});

Keywords

FAQs

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