tough-cookie-store

0.0.6 • Public • Published

File Cookie Store

NPM

tough-cookie-filestore is a File store modified from tough-cookie-filestore, fully compatible with it. And add some functions needed in use.

installation

$ npm install tough-cookie-store

Usage

  var FileCookieStore = require("tough-cookie-store"),
      request = require('request');
  
  var fileStore = new FileCookieStore(filePath, option);
  var jar = request.jar(fileStore);
  var req = request.defaults({jar: jar});

Options

filePath

file path of cookie file.

option

with or without encrypt

option.encrypt

true as default, unless explicitly specified as false fileStore will encrypt the cookie file with the default setting.

option.algorithm

'aes-256-cbc'as default, you can use any algorithm nodejs supported.

option.password

'tough-cookie-store'as default.

API

see tough-cookie#store-api

extra API

fileStore.getCookie(domain, path, key)

sync version of fileStore.findCookie, return a cookie object.

fileStore.flush()

write current cookies to file.

fileStore.isEmpty()

check if fileStore is empty.

License

MIT

Package Sidebar

Install

npm i tough-cookie-store

Weekly Downloads

1

Version

0.0.6

License

MIT

Last publish

Collaborators

  • cath