lru-file-cache
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

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;
});

Readme

Keywords

Package Sidebar

Install

npm i lru-file-cache

Weekly Downloads

3

Version

0.1.7

License

MIT

Unpacked Size

31.1 kB

Total Files

21

Last publish

Collaborators

  • tharindu96