
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
najm-cache
Advanced tools
Unified cache plugin for najm framework - Memory and Redis drivers with auto-fallback
Unified cache plugin for Najm with Memory and Redis drivers. Auto-falls back to in-memory when Redis is unavailable.
bun add najm-cache
Peer dependency: reflect-metadata (optional). Optional peer: ioredis.
import { Server } from 'najm-core';
import { cache } from 'najm-cache';
await new Server()
.use(cache())
.listen(3000);
await new Server()
.use(cache({ redis: { url: process.env.REDIS_URL! } }))
.listen(3000);
Redis is optional — if not available, falls back to in-memory automatically.
import { Service, Injectable } from 'najm-core';
import { CacheService } from 'najm-cache';
@Injectable()
class MyService {
constructor(private cache: CacheService) {}
async getUser(id: string) {
return this.cache.getOrSet(`user:${id}`, () => fetchUser(id), 300000);
}
async invalidateUser(id: string) {
await this.cache.delete(`user:${id}`);
}
}
| Method | Description |
|---|---|
get(key) | Get a value |
set(key, value, ttlMs?) | Set a value with optional TTL |
delete(key) | Delete a key |
getJson<T>(key) | Get and parse JSON |
setJson(key, value, ttlMs?) | Set JSON value |
getOrSet(key, factory, ttlMs?) | Cache-aside pattern |
incr(key, ttlMs?) | Atomic increment (for rate limiting) |
najm-auth uses the cache plugin — configure Redis for distributed session revocationreflect-metadata optional peer dependency; only needed if using DI decoratorsFAQs
Unified cache plugin for najm framework - Memory and Redis drivers with auto-fallback
We found that najm-cache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.