https://github.com/mscdex/lrused
An LRU cache for node.js
https://github.com/mscdex/lrused
Last synced: over 1 year ago
JSON representation
An LRU cache for node.js
- Host: GitHub
- URL: https://github.com/mscdex/lrused
- Owner: mscdex
- License: mit
- Created: 2024-03-14T05:01:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-14T05:03:18.000Z (over 2 years ago)
- Last Synced: 2024-10-18T09:04:52.739Z (almost 2 years ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Description
A simple and efficient LRU cache for [node.js](http://nodejs.org/).
## Installation
npm install lrused
## API
* **(constructor)**(< _integer_ >capacity) - Creates and returns a new LRU cache instance with the given maximum capacity.
* **get**(< _mixed_ >key) - _mixed_ - Returns the cached data identified by `key` and refreshes the cache entry.
* **set**(< _mixed_ >key, < _mixed_ >value) - _(void)_ - Adds or updates and refreshes the cache entry identified by `key` with the given `value`.