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

@allem-sdk/hooks

v0.1.3

Published

8 essential React hooks: useDebounce, useLocalStorage, useMediaQuery, useClickOutside, useToggle, useCopyToClipboard, useIntersectionObserver, useWindowSize. SSR-safe, TypeScript strict.

Readme

@allem-sdk/hooks

Essential React hooks for modern applications. SSR-safe, zero dependencies, works with Next.js, Vite, and Remix.

Installation

npm install @allem-sdk/hooks

Hooks

| Hook | Description | |------|-------------| | useDebounce | Debounce a value by a given delay | | useThrottle | Throttle a value, updating at most once per delay | | useLocalStorage | Persist state in localStorage with SSR safety | | useMediaQuery | Reactive CSS media query matching | | useClickOutside | Detect clicks outside a ref element | | useToggle | Boolean toggle state | | useCopyToClipboard | Copy text to clipboard with status | | useIntersectionObserver | Observe element visibility via IntersectionObserver | | useWindowSize | Reactive window dimensions | | useFetch | Data fetching with loading/error states and refetch | | usePrevious | Track the previous value of a variable | | useKeyPress | Detect if a specific key is pressed | | useOnlineStatus | Reactive browser online/offline status |

Usage

import { useDebounce, useLocalStorage, useMediaQuery } from "@allem-sdk/hooks";

function Search() {
  const [query, setQuery] = useLocalStorage("search", "");
  const debouncedQuery = useDebounce(query, 300);
  const isMobile = useMediaQuery("(max-width: 768px)");

  return <input value={query} onChange={(e) => setQuery(e.target.value)} />;
}
import { useClickOutside, useToggle } from "@allem-sdk/hooks";

function Dropdown() {
  const [isOpen, toggle] = useToggle(false);
  const ref = useClickOutside<HTMLDivElement>(() => toggle(false));

  return (
    <div ref={ref}>
      <button onClick={() => toggle()}>Menu</button>
      {isOpen && <ul>...</ul>}
    </div>
  );
}

More Examples

import { useFetch, useThrottle, useKeyPress, useOnlineStatus, usePrevious } from "@allem-sdk/hooks";

function UserList() {
  const { data, error, isLoading, refetch } = useFetch<User[]>("/api/users");
  const isOnline = useOnlineStatus();
  const isEscPressed = useKeyPress("Escape");

  if (!isOnline) return <p>You are offline</p>;
  if (isLoading) return <p>Loading...</p>;
  return <ul>{data?.map((u) => <li key={u.id}>{u.name}</li>)}</ul>;
}

function ScrollTracker() {
  const [scroll, setScroll] = useState(0);
  const throttledScroll = useThrottle(scroll, 100);
  const prevScroll = usePrevious(throttledScroll);
  const direction = prevScroll !== undefined && throttledScroll > prevScroll ? "down" : "up";

  useEffect(() => {
    const handler = () => setScroll(window.scrollY);
    window.addEventListener("scroll", handler);
    return () => window.removeEventListener("scroll", handler);
  }, []);

  return <p>Scrolling {direction}</p>;
}

Part of Allem SDK

This package can be used standalone or as part of the full SDK. Install allem-sdk to get all packages in one install.

Support

If you find Allem SDK useful, consider supporting its development:

License

MIT - Ahmed Allem