tiny-fifo-cache

1.0.1 • Public • Published

NPM version Build Status Dependency Status

Simple FIFO cache. put and get.

Install

$ npm install --save tiny-fifo-cache

Usage

var FIFOCache = require('tiny-fifo-cache');
 
var maxItems = 100;
var cache = new FIFOCache(maxItems);
cache.put('key', 'value');
cache.get('key'); // returns 'value'

FIFO Eviction Policy

Once the cache reaches its maximum size, the oldest item is removed.

Development

npm install
npm test

License

MIT © Andy Hume

Package Sidebar

Install

npm i tiny-fifo-cache

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • ahume