Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

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

install

npm i tiny-fifo-cache

Downloadsweekly downloads

6

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar