2.0.1 • Published 10 years ago

chaps v2.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

Chaps npm.io

LRU cache fronted superagent

Usage

var chaps = new Chaps({
  hostname: 'localhost',
  timeout: 2000,
  cache: true, // default as of @2.0.0, set to false to disable
  LRU: { // implies cache: true
    // options passed to LRU object, see LRU lib for more options
    // default LRU values chaps provides
    length: function () { return 1; },
    max: 100,
    maxAge: 60000  // cache for 1 minute
  },
  cacheKeyExcludes: ['query.foo', 'query.bar.aaa'], // sting dot notation of object values to not impact caching routes
  stringify: ['query.foo'] // string dot notation of object values to JSON.stringify before sending request
});

chaps.get({
  url: '/foo'  // url to hit
}, function(err, res){

});
2.0.1

10 years ago

2.0.0

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.0.1

10 years ago