Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

lru-cache-fs2

bluelovers430MIT2.0.8TypeScript support: included

Extends lru-cache to add file system support

cache, lru-cache, env-paths, fs

readme

lru-cache-fs

NPM version Build Status MIT license

Extends lru-cache to add file system support.

Install

npm install lru-cache-fs

Usage

Retrieve cache:

const Cache = require('lru-cache-fs')

const cache = new Cache({
    max: 100,
    cacheName: "cache" // filename ref to be used
});

By default it will use os specific paths, using env-paths.

Then retrieve/set items using:

cache.get('some-item') // returns whatever was stored
cache.set('some-new-item', 'foo') // sets new item and stores cache sync to fs

The fsDump() method exposes an API that allows you to persist the current cache on your file system:

cache.fsDump()

All other methods from lru-cache should be available, e.g:

cache.dump() // retrieves dump of current cache memory

License

MIT © 2019 Ruy Adorno

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.0.8 (2021-07-03)

🛠 Build System

2.0.7 (2021-05-28)

Note: Version bump only for package lru-cache-fs2

2.0.6 (2021-05-28)

✨ Features

  • update deps and support WriteOptions for fsDump (bde9f16)

2.0.5 (2020-08-11)

Note: Version bump only for package lru-cache-fs2

2.0.4 (2020-08-09)

Note: Version bump only for package lru-cache-fs2

2.0.3 (2020-08-09)

🔖 Miscellaneous

2.0.2 (2020-08-09)

📦 Code Refactoring

🛠 Build System

🔖 Miscellaneous

  • . (9339d4c)
  • Add 'packages/lru-cache-fs/' from commit 'b6917ec1beac4a617a278f18ced13fb9afaa9fb4' (155ee46)