npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nope-redis

v2.1.0

Published

Simple & Fast Node.JS memory caching

Downloads

413

Readme

nope-redis

Simple & Fast Node.js in-memory caching — Redis-like functionality without a Redis server.

  • 🚀 Fast: 1M+ SET, 2M+ GET ops/sec with a flat heap under sustained load
  • TTL: automatic key expiration with eager cleanup on read
  • 🔄 Eviction: LRU, LFU and TTL policies with a configurable memory limit (MB)
  • 🎯 Batch operations, 📈 statistics, 🛡️ self-recovery, 📘 TypeScript types
  • 🔌 Works with both ESM (import) and CommonJS (require) — one shared cache instance
  • 🔧 Zero runtime dependencies — single file, Node.js ≥ 18

Install

npm install nope-redis

Quick Start

Works with both CommonJS and ESM — both entry points share the same cache instance.

// CommonJS
const nopeRedis = require('nope-redis');

nopeRedis.setItem('user:1', { name: 'John', age: 30 }, 10); // TTL: 10s
const user = nopeRedis.getItem('user:1'); // { name: 'John', age: 30 } — null if missing/expired
nopeRedis.deleteItem('user:1');

// Optional runtime configuration
nopeRedis.config({ defaultTtl: 60, maxMemorySize: 100, evictionPolicy: 'lru' });
// ESM — default and named imports are both supported
import nopeRedis, { setItem, getItem } from 'nope-redis';

setItem('user:1', { name: 'John', age: 30 }, 10);
const user = getItem('user:1');
nopeRedis.deleteItem('user:1'); // same singleton as the named imports

TypeScript definitions are included (setItem<T>, getItem<T>, …).

API at a Glance

| Function | Description | Returns | |----------|-------------|---------| | setItem(key, value, ttl?) | Store any JS value (default TTL: 30s) | boolean | | getItem(key) | Read a value | T \| null \| false | | deleteItem(key) | Remove a key | boolean | | itemStats(key) | Per-key expires_at, remaining_seconds, hit | ItemStats \| null \| false | | setItems(items) | Bulk set [{ key, value, ttl? }] | boolean[] \| false | | getItems(keys) | Bulk read | Record<string, T \| null> \| false | | deleteItems(keys) | Bulk remove | boolean | | stats(options?) | Cache-wide statistics (showSize for memory usage) | Stats \| false | | config(options) | defaultTtl, maxMemorySize (MB), evictionPolicy, maxChecksPerCycle, isMemoryStatsEnabled | boolean | | flushAll() | Clear all data, keep service running | boolean | | SERVICE_KILL() / SERVICE_START() | Stop / restart the background service | Promise<boolean> |

All functions return false when the service is stopped. Full reference with examples: docs/README.md.

Performance

Node v24.18.0 · AMD EPYC 7763 64-Core Processor · linux x64 · 2026-07-15 — refreshed automatically by the Update README benchmarks workflow.

| Operation | ops/sec | ns/op | |-----------|--------:|------:| | SET (fresh string keys) | 2,281,928 | 438 | | SET (nested JSON, ~30 nodes) | 643,008 | 1,555 | | SET (overwrite existing keys) | 4,311,185 | 232 | | GET hit (100k keyspace) | 3,036,232 | 329 | | GET miss | 44,887,845 | 22 | | DELETE | 4,325,878 | 231 | | Mixed (70% get / 20% set / 10% delete) | 2,789,967 | 358 | | BATCH setItems (100 items/call) | 4,212,197 | 237 | | BATCH getItems (100 keys/call) | 1,354,869 | 738 |

No memory leaks: expired entries are freed eagerly and byte accounting returns to exactly zero when the cache empties — see the detailed performance notes for methodology and more details. Reproduce locally with npm run bench.

Documentation

Detailed docs live in docs/README.md:

Good to know: single-process only (not distributed), no persistence, values are stored by reference, keys must be strings, TTL is whole seconds.

License

MIT — Orhan Aydogdu (orhanayd) · npm · issues