Socket
Socket
Sign inDemoInstall

cookie-api-handler

Package Overview
Dependencies
5
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cookie-api-handler

Handler for cookie APIs


Version published
Weekly downloads
35
increased by1066.67%
Maintainers
1
Install size
413 kB
Created
Weekly downloads
 

Changelog

Source

v2.25.15 (2022-03-28)

Fixed

  • 118a8c0 Update lock to make security bots happy.

Readme

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

Last updated on 28 Mar 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc