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

@ts-hooks-kit/core

v0.2.0

Published

React hook library based on usehooks-ts, upgraded for React 19 compatibility.

Readme

@ts-hooks-kit/core

An actively maintained React hooks library based on usehooks-ts, upgraded for React 18/19 compatibility.

npm version license CI bundle size

Install

npm install @ts-hooks-kit/core
# or
pnpm add @ts-hooks-kit/core
# or
yarn add @ts-hooks-kit/core

Quick Start

import { useBoolean, useLocalStorage } from '@ts-hooks-kit/core'

export function Example() {
  const [enabled, toggleEnabled] = useBoolean(false)
  const [name, setName] = useLocalStorage('name', 'ts-hooks-kit')

  return (
    <button type="button" onClick={toggleEnabled}>
      {enabled ? `Enabled for ${name}` : 'Disabled'}
    </button>
  )
}

Features

  • 50 hooks ready for production use
  • React ^18 || ^19 — CI-tested on both versions
  • TypeScript-first — full type inference, exported types for all hooks
  • Zero runtime dependencies — React as peer dependency only
  • ESM + CJS — dual output via tsdown, tree-shakeable (sideEffects: false)
  • SSR-safe — server guards on browser-dependent hooks

Hooks

State & Lifecycle

| Hook | Description | |------|-------------| | useBoolean | Boolean state with toggle/set helpers | | useCounter | Numeric counter with increment/decrement/set/reset | | useList | Enhanced array state management | | useMap | Reactive Map data structure | | useSet | Reactive Set data structure | | useQueue | FIFO queue data structure | | useToggle | Toggle between two values | | useStep | Step-based state navigation | | useStateList | Navigate through a list of states | | usePrevious | Track previous state/prop value | | useDisclosure | Modal/drawer open/close/toggle state | | usePagination | Pagination logic with range generation | | useUpdate | Force component re-render | | useUnmount | Run cleanup on unmount | | useIsMounted | Check if component is mounted | | useIsClient | Check if running on client side |

Effects & Callbacks

| Hook | Description | |------|-------------| | useUpdateEffect | useEffect that skips initial mount | | useEventCallback | Stable callback reference | | useMemoizedFn | Stable function reference without deps | | useIsomorphicLayoutEffect | SSR-safe useLayoutEffect | | useAsync | Async function state with loading/error/retry |

Timing & Debounce

| Hook | Description | |------|-------------| | useDebounceCallback | Debounced callback with cancel/flush | | useDebounceValue | Debounced value | | useThrottle | Throttle execution (fn + value variants) | | useTimeout | setTimeout with auto-cleanup | | useInterval | setInterval with auto-cleanup | | useCountdown | Countdown timer | | useIdle | Detect user idle state |

DOM & Browser

| Hook | Description | |------|-------------| | useEventListener | Type-safe event listener binding | | useClickAnyWhere | Detect clicks anywhere on the page | | useOnClickOutside | Detect clicks outside an element | | useHover | Detect hover state | | useIntersectionObserver | Intersection Observer API wrapper | | useResizeObserver | Resize Observer API wrapper | | useScrollLock | Lock body scroll | | useDocumentTitle | Set document title | | useScript | Dynamic script loading | | useWindowSize | Track window dimensions | | useScreen | Track screen properties | | usePageLeave | Detect when user leaves page |

Storage

| Hook | Description | |------|-------------| | useLocalStorage | Persistent state in localStorage | | useSessionStorage | Persistent state in sessionStorage | | useReadLocalStorage | Read-only localStorage access | | useCopyToClipboard | Copy text to clipboard |

Media & Network

| Hook | Description | |------|-------------| | useMediaQuery | Responsive media query matching | | useDarkMode | Dark mode toggle | | useTernaryDarkMode | Dark/light/system mode | | useNetwork | Network status monitoring | | useGeolocation | Browser geolocation API | | usePermission | Browser permissions API |

Migrating from usehooks-ts

This package is API-compatible with [email protected]. To migrate, change your imports:

// before
import { useLocalStorage } from 'usehooks-ts'

// after
import { useLocalStorage } from '@ts-hooks-kit/core'

A codemod is available for automated migration — see the migration guide.

License

MIT — see LICENSE for details.

Based on usehooks-ts by Julien CARON.