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

@maynkudu/hooks

v0.11.0

Published

A collection of hooks (as the name states).

Downloads

834

Readme

@maynkudu/hooks

A collection of lightweight, type-safe React hooks designed for performance and reliability. Built with SSR-safety and tree-shaking at its core.

npm version License: MIT


Why @maynkudu/hooks?

  • SSR Ready: Internal checks for window and document ensure compatibility with Next.js, Remix, etc.
  • Fully Tree-Shakeable: Import only the hooks you need; keep your bundle lean.
  • TypeScript-First: Explicit generics and inferred return types for a better DX.
  • Production Tested: Handles edge cases like component unmounting during async operations and event listener cleanup.

Installation

# With npm
npm install @maynkudu/hooks@latest

# With yarn
yarn add @maynkudu/hooks@latest

# With pnpm
pnpm add @maynkudu/hooks@latest

# With bun
bun add @maynkudu/hooks@latest

Quick Start

import { useWindow, useDebounce, useClipboard } from "@maynkudu/hooks";

const SearchComponent = () => {
  const [searchTerm, setSearchTerm] = useState("");
  const { width } = useWindow();
  
  // Debounce expensive operations
  const debouncedSearch = useDebounce(searchTerm, 300);

  // Simple clipboard access
  const { copy, copied } = useClipboard();

  return (
    <div>
      <input 
        value={searchTerm} 
        onChange={(e) => setSearchTerm(e.target.value)} 
        placeholder="Search..."
      />
      {width < 768 ? <MobileUI /> : <DesktopUI />}
      <button onClick={() => copy(debouncedSearch)}>
        {copied ? "Value Copied!" : "Copy Debounced Value"}
      </button>
    </div>
  );
};

Comprehensive Hook Catalog

📱 Responsive & Layout

| Hook | Purpose | | :--- | :--- | | useWindow | Track viewport dimensions with optimized resize listeners. | | useMobile, useTablet, useDesktop | Direct boolean checks for common device breakpoints. | | useMatchMedia | Reactive interface for custom CSS media queries. | | useScrollPosition | Performance-optimized scroll tracking. | | useVisible | Intersection Observer wrapper to detect element visibility. |

⚙️ State & Logic

| Hook | Purpose | | :--- | :--- | | useLocalStorage | Type-safe state persistence synced across tabs. | | useUndo | Complex state history management (Undo/Redo logic). | | useDebounce | Value debouncing to limit high-frequency updates. | | useInterval | Declarative setInterval that pauses when the component unmounts. |

🖱️ User Interaction

| Hook | Purpose | | :--- | :--- | | useHover | Tracks hover state via mouseEnter/mouseLeave. | | useKeyPress | Global or scoped keyboard event listeners. | | useClipboard | Modern API for clipboard operations with feedback state. | | useIdle | Detect user inactivity based on a configurable timeout. | | useCursor | Real-time mouse coordinate tracking. |

🌐 Browser & System

| Hook | Purpose | | :--- | :--- | | useOnline | Reactive network status (online/offline). | | usePageVisibility | Detect when the user switches tabs or minimizes the window. | | usePreferredLanguage | Access the browser's locale settings reactively. | | useRetryAsync | Wrapper for async calls with configurable retry strategies. |


Core Principles

  1. No Magic: Hooks behave predictably according to the React lifecycle.
  2. Performance: Event listeners are passive where possible and cleaned up on unmount.
  3. Strict Typing: Every hook is written in TypeScript, providing full intellisense for your IDE.

Requirements

  • React: ^18.0.0
  • TypeScript: ^4.5.0 (Optional, but recommended)

Contributing

We value pragmatic improvements. If you'd like to contribute, please:

  1. Fork the repo.
  2. Create a feature branch.
  3. Ensure your hook follows the SSR-safety pattern.
  4. Submit a PR.

License

MIT © maynkudu