Jerome Etienne Notes
Just released Pacmaze my first WebGL game! Check it out!

microcache.js - cache micro library


microcache.js is a micro library to handle in-memory cache. It is less than 20 lines and works in node and browser. It is available on github here under MIT license. If you hit bugs, fill issues on github. Feel free to fork, modify and have fun with it :)

Install it

To install it on node

npm install microcache

To install the browser version, download it and include it like that

<script src="microcache.js"></script>   


To instanciate a cache, do the following. You can have as many instances you want.

var microcache = new MicroCache();


To get a cached asset which is in the cache. Each cached element has a unique key to identify it.


.set(key, value)

To set a element value in the cache.

microcache.set('foo', 'bar');


To know if a given asset is currently in the cache.



To return all the elements currently in the cache


.getSet(key, value)

To get an element from the cache, if it isnt already present, store it then return it

microcache.getSet(key, value);
Follow jerome_etienne on Twitter