npm.io
1.0.6 • Published 11 years ago

tough-cookie-framework

Licence
MIT
Version
1.0.6
Deps
1
Vulns
3
Weekly
0

tough-cookie-framework is a framework of tough-cookie module. See tough-cookie documentation for more info.

installation

$ npm install tough-cookie-framework

Options

options : a javascript object.<br>

{
   key:string,
   get:function(key,callback){},
   put:function(key,data){} 
}

Usage

  var CookieStoreFramework = require("tough-cookie-framework");
  var CookieJar = require("tough-cookie").CookieJar;
  var storeEngine = new StoreEngine(); //your store engine impl

  var jar = new CookieJar(new CookieStoreFramework({
      key:'abcd',
      get:function(key,callback){
          storeEngine.get(key,callback);
      },
      put:function(key,value,callback){
          storeEngine.put(key,value,callback);
      }
  });
  

License

MIT

Keywords