Skip to content

Chrome cookie manager for node. To set and get cookie from chrome

License

Notifications You must be signed in to change notification settings

meijintao233/chrome-cookie

 
 

Repository files navigation

chrome-cookie

Build Status

Node Cookie Manager for Chrome, read / write cookie from sqlite db

Install

npm i chrome-cookie

Usage

const ChromeCookie = require('chrome-cookie');

const cookie = await new ChromeCookie().getCookie('https://github.com');
console.log(cookie);


const DATA = [
  {
    'creation_utc': 'now',
    'encrypted_value': 'enc2',
    'expires_utc': 'never',
    'firstpartyonly': 'yes',
    'has_expires': 'yes',
    'host_key': 'arshad.com',
    'is_httponly': 'yes',
    'is_persistent': 'no',
    'is_secure': 'yes',
    'last_access_utc': 'now',
    'name': 'arshad',
    'path': '/root',
    'priority': 'no',
    'value': 'kazmi',
  }
];

await ChromeCookie.setCookie(DATA);

API

  • getCookie(path)

    • Returns cookie json from database for the input path
      • Params
        • path (JSON)
  • setCookie(cookies)

    • Adds all the input cookies into the sqlite database
      • Params
        • cookies (Array of cookies object)

Contributing

Interested in contributing to this project? You can log any issues or suggestion related to this library here

Read our contributing guide on getting started with contributing to the codebase

Contributors

Thank you to all the contributors who have helped us in making this project better 🙌

About

Chrome cookie manager for node. To set and get cookie from chrome

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%