Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meixg/fastify-lru-cache
fastify plugin for lru cache
https://github.com/meixg/fastify-lru-cache
Last synced: 5 days ago
JSON representation
fastify plugin for lru cache
- Host: GitHub
- URL: https://github.com/meixg/fastify-lru-cache
- Owner: meixg
- Created: 2022-04-13T05:04:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-13T07:07:44.000Z (almost 3 years ago)
- Last Synced: 2024-12-16T15:14:47.623Z (about 1 month ago)
- Language: JavaScript
- Size: 179 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# fastify-lru-cache
fastify plugin for lru cache
## install
```bash
npm install fastify-lru-cache
```## Usage
```javascript
const fastify = require('fastify')()
const fastifyLRUCache = require('fastify-lru-cache')fastify
.register(fastifyLRUCache, {
instance: 'lru',
max: 500
})
.ready()fastify.listen(3000, () => {
console.log('> listening on port 3000')
})
```- `instance`: *(optional)* the name of instance will be mapped to fastify, default is `cache`
- other lru-cache configurations, you can see [here](https://github.com/isaacs/node-lru-cache#options).