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

@lp-labs/reactive-query

v0.1.0

Published

Bounded in-memory async query cache with deduplication, expiry, and explicit eviction.

Readme

@lp-labs/reactive-query

A small async query cache with request deduplication, TTL expiry, LRU eviction and a hard entry limit. It has no runtime or peer dependencies and does not perform network requests itself.

Install

npm install @lp-labs/reactive-query

Includes ESM and CommonJS builds and TypeScript declarations. CommonJS consumers can use require('@lp-labs/reactive-query').

Quickstart

import { createReactiveQuery } from '@lp-labs/reactive-query';

const queries = createReactiveQuery({
  maxEntries: 250,
  ttlMs: 15_000,
});
const record = await queries.query('record:42', async () => ({ id: '42', title: 'Example' }));
console.log(record.title);

API and customization

  • createReactiveQuery<T>({ maxEntries = 500, ttlMs = 30000, now = Date.now }) creates a process-local cache. Limits must be positive safe integers; TTL is finite and non-negative.
  • query(key, load) deduplicates concurrent work for the same key and stores successful results for the configured TTL. Failed work is removed so a later call may retry.
  • get(key) returns a fresh cached value or undefined; set, invalidate, and clear manage entries. Keys must be trimmed, nonempty strings no longer than 256 characters.
  • snapshot() reports entry, pending-work, and configured capacity counts.

At capacity, the least-recently-used completed value is evicted. Pending work is never evicted; when every slot is pending, a new distinct query fails with QueryCacheError (code: 'capacity'). Set ttlMs: 0 to disable retention while keeping in-flight deduplication. The injected clock makes expiry deterministic in tests.

Limitations

This is an in-memory cache, not a reactive UI state framework. It has no persistence, query-key serialization, automatic invalidation graph, cancellation, stale-while-revalidate, cross-process coordination, or protection against callers mutating cached object values. Cache keys and value ownership are application responsibilities.

Support

If this library is useful to you, consider supporting its maintenance with a donation via PayPal.

Author

Created by Libin Prasanth. Connect on LinkedIn for updates and discussion.