cachefactory

Registered as cachefactory in NPM and Bower.

Source:
Examples

Install from NPM

npm i --save cachefactory

Install from Bower

bower i --save cachefactory

Load into your app via script tag

<script src="/path/to/cachefactory.min.js"></script>

Load into your app via CommonJS

var CacheFactory = require('cachefactory');

Load into your app via ES2015 Modules

import CacheFactory from 'cachefactory';

Load into your app via AMD

define('myApp', ['cachefactory'], function (CacheFactory) { ... })

Members

(static) BinaryHeap :function

The BinaryHeap constructor function.

Type:
  • function
Source:
See:
Example
import CacheFactory from 'cachefactory';
const { BinaryHeap } = CacheFactory;

(static) Cache :function

The Cache constructor function.

Type:
  • function
Source:
See:
Example
import CacheFactory from 'cachefactory';
const { Cache } = CacheFactory;

(static) defaults :object

The default cache values. Modify this object to change the default values.

Type:
  • object
Source:
See:
Example
import CacheFactory from 'cachefactory';
const { defaults } = CacheFactory;

// Change the default "maxAge" for caches that will be instantiated
// after this point.
defaults.maxAge = 60 * 60 * 1000;

(static) utils :object

Utility functions used throughout this library.

Type:
  • object
Source:
Example
import Promise from 'bluebird';
import CacheFactory from 'cachefactory';
const { utils } = CacheFactory;

// Make this library use your Promise lib
utils.Promise = Promise;