Socket
Socket
Sign inDemoInstall

tough-cookie-file-store

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tough-cookie-file-store - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

13

lib/file-store.js

@@ -170,2 +170,6 @@ 'use strict';

FileCookieStore.prototype.isEmpty = function (){
return isEmptyObject(this.idx);
}
function saveToFile(filePath, data, cb) {

@@ -202,2 +206,11 @@ var dataJson = JSON.stringify(data);

cb(dataJson);
}
function isEmptyObject(obj) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
return false;
}
}
return true;
}

2

package.json
{
"name": "tough-cookie-file-store",
"description": "Another file store for tough-cookie module",
"version": "1.0.0",
"version": "1.1.0",
"author": "Ivan Marban",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/ivanmarban/tough-cookie-file-store",

# tough-cookie-file-store
[![NPM](https://nodei.co/npm/tough-cookie-file-store.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/tough-cookie-file-store/)
Another file store for tough-cookie module.

@@ -13,10 +16,19 @@

``` js
var FileCookieStore = require('tough-cookie-file-store');
var cookieStore = require('tough-cookie-file-store');
var CookieJar = require('tough-cookie').CookieJar;
var jar = new CookieJar(new FileCookieStore('./cookie.json'));
var jar = new CookieJar(new cookieStore('./cookie.json'));
/* check if cookie is expired */
var cookieStore = require('tough-cookie-filestore');
/* check if cookie is empty or expired */
var cookieStore = require('tough-cookie-file-store');
var cookieInstance = new cookieStore('./cookie.json');
cookieInstance.isExpired() // will return True if the cookies is expired
cookieInstance.isExpired() // will return True if the cookie is expired
cookieInstance.isEmpty() // will return True is cookie is empty
/* request example */
var cookieStore = require('tough-cookie-file-store');
var j = request.jar(new cookieStore('./cookie.json'));
request = request.defaults({ jar : j })
request('http://www.google.com', function() {
request('http://images.google.com')
})
```

@@ -39,2 +51,2 @@

[4]: https://github.com/vladh
[5]: https://github.com/zhzehong
[5]: https://github.com/zhzehong
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