lru-send

⏩ LRU-based caching middleware for Node.js

Showing:

Popularity

Downloads/wk

2

GitHub Stars

6

Maintenance

Last Commit

1mo ago

Contributors

1

Package

Dependencies

1

License

MIT

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

lru-send

npm GitHub Workflow Status Coverage

LRU-based caching middleware for Node.js that patches res.send.

Features

  • 😲 ~336x faster for heavy operations
  • ⚡ ESM-only
  • ✨ types out of the box
  • 🟥 (optionally) supports Redis

Install

pnpm i lru-send

Examples

In-memory

import { lruSend } from 'lru-send'
import { App } from '@tinyhttp/app'

const app = new App()

app.use(lruSend())

app.use('/', (_req, res) => {
  someUltraHeavyOp()
  res.send('hello')
})

app.listen(3000)

Redis

import { lruSend } from 'lru-send/redis'
import { App } from '@tinyhttp/app'
import Redis from 'ioredis'

const redis = new Redis()

const app = new App()

app.use(lruSend(redis))

app.use('/', (_req, res) => {
  someUltraHeavyOp()
  res.send('hello')
})

app.listen(3000)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100