🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

chaps

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chaps

cache fronted http api caller

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
2
Created
Source

Chaps

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){

});

Keywords

request

FAQs

Package last updated on 04 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts