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

light-hooks

v2.7.3

Published

A comprehensive collection of performant React hooks for modern web development

Readme

A lightweight React hooks library built for performance and developer experience.

npm version npm downloads bundle size TypeScript

npm install light-hooks

✨ Why light-hooks?

light-hooks delivers production-ready React hooks that prioritize performance without sacrificing developer experience. Each hook is carefully optimized using modern browser APIs and best practices.

  • 🪶 Ultra-lightweight — Tree-shakable with minimal runtime overhead
  • ⚡ Performance-first — Uses ResizeObserver, stable refs, and optimized event handling
  • 🎯 TypeScript native — Written in TypeScript with complete type safety
  • 🔧 SSR compatible — Zero hydration mismatches, works everywhere
  • 🎨 Developer friendly — Intuitive APIs with comprehensive documentation

Quick Start

import { useLocalStorage, useIsMobile } from 'light-hooks'

export default function App() {
  const [count, setCount] = useLocalStorage('counter', 0)
  const isMobile = useIsMobile()

  return (
    <div>
      <h1>{isMobile ? '📱' : '💻'} Counter: {count}</h1>
      <button onClick={() => setCount(count + 1)}>
        Increment
      </button>
    </div>
  )
}

🎣 Hooks

useIsMobile — Mobile device detection with ResizeObserver for zero-cost updates.

useClickOutside — Handle clicks outside elements. Perfect for modals and dropdowns.

useCountdown — Flexible countdown timers with start/pause/reset controls.

useLocalStorage — Persistent state with automatic serialization and cross-tab sync.

usePing — Network connectivity monitoring with real-time latency measurement.

useHotKey — Keyboard shortcuts with modifier keys and conflict-free bindings.

useEvent — Advanced event handling with delegation and performance optimization.

usePermission — Browser permissions management with unified API for camera, microphone, notifications.

useScroll — Advanced scroll monitoring with direction tracking, velocity, and scroll locking controls.

useDebounce — Delay value updates until activity stops. Essential for search inputs and API calls.

useThrottle — Rate-limit function execution at regular intervals. Perfect for scroll and resize handlers.

useGeolocation — User location access with permissions, error handling, and position watching.

useIdle — User inactivity detection with configurable timeout and cross-tab synchronization.

useFetch — Complete data fetching with loading states, caching, retries, and request cancellation.

useToggle — Simple boolean state management with toggle, setTrue, setFalse controls.

useCopyToClipboard — Copy text to clipboard with modern API, fallback support, and user feedback.

usePolling — Data polling with interval and long polling support, retry logic, and comprehensive error handling.

useWebSocket — Real-time data streaming with automatic reconnection and message handling.

📚 Learn More

Visit lighthooks.com for detailed documentation, examples, and API references.

🛠️ Contributing

We welcome contributions! Check out our contributing guide to get started.

👥 Contributors

Thanks to these amazing people who have contributed to light-hooks:

📝 License

MIT © Gourav2609