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

steady-hooks

v0.1.2

Published

Stable, predictable React hooks for async, state, and browser behavior

Readme

steady-hooks ⚓

npm version npm downloads bundle size license TypeScript tree-shakable

Stable, predictable React hooks for async, state, and browser behavior.

steady-hooks is a lightweight, production-ready collection of React hooks focused on:

  • 🛡️ Safety (no memory leaks, no race conditions)
  • 🔁 Predictable behavior
  • 🧼 Clean and minimal APIs
  • 🌍 Real-world use cases

Built with TypeScript, fully tree-shakable, and framework-agnostic.


✨ Features

  • ✅ Safe async handling (prevents stale updates & race conditions)
  • ✅ Browser & environment utilities
  • ✅ Zero external runtime dependencies
  • ✅ Fully typed with TypeScript
  • ✅ Tree-shakable
  • ✅ Small bundle size

📦 Installation

npm install steady-hooks

or

yarn add steady-hooks

🚀 Usage

import { useStableAsync, useIsMobile } from "steady-hooks";

🪝 Available Hooks

useStableAsync

Safe async execution with built-in race-condition prevention.

const { run, data, loading, error } = useStableAsync(fetchUsers);

useEffect(() => {
  run();
}, []);

Use cases

  • API calls
  • Search requests
  • Async side effects

useDebouncedValue

Debounce rapidly changing values.

const debouncedSearch = useDebouncedValue(search, 500);

useIsMobile

Detect mobile viewport using ResizeObserver.

const isMobile = useIsMobile();

useClickOutside

Detect clicks outside a referenced element.

useClickOutside(ref, () => setOpen(false));

useCountdown

Countdown timer with start, pause, and reset controls.

const { seconds, start, pause, reset } = useCountdown(60);

useLocalStorage

Persistent state synchronized across browser tabs.

const [theme, setTheme] = useLocalStorage("theme", "light");

usePing

Monitor network connectivity and latency.

const { online, latency } = usePing();

useLatestRef

Always access the latest value (prevents stale closures).

const latestValue = useLatestRef(value);

usePreviousValue

Retrieve the previous value of state or props.

const prev = usePreviousValue(value);

useMounted

Safely check if a component is currently mounted.

const isMounted = useMounted();

useOnceEffect

Run an effect exactly once.

useOnceEffect(() => {
  init();
});

🧠 Philosophy

steady-hooks prioritizes correctness over cleverness:

  • Predictable behavior over hacks
  • Safe defaults
  • Explicit, readable APIs

Designed for real production systems, not demos.


🌟 Contributing

Contributions are welcome!

  • Open issues
  • Suggest new hooks
  • Submit pull requests

📄 License

MIT © 2026 Anuj Gadekar


🔗 Links