Skip to content

THasthika/node-lru-file-cache

Repository files navigation

Node.js CI

LRU File Cache

A 2 tier caching for files

Usage

import { LRUFileCache } from "lru-file-cache";

const cache = new LRUFileCache({
  'ram_cache_size': '1 GB',
  'fs_cache_size': '2 GB',
  'tmp_folder': '/tmp/__my_cache__'
});

cache.addFile('image_01', './xx.jpg').then(_ => {

}).catch(err => {
  throw err;
});

cache.getFile('image_01').then(data => {
  // data is a buffer or undefined
}).catch(err => {
  throw err;
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published