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

anshin

v0.4.3

Published

anshin (安心) - React hooks that give you peace of mind. Utility hooks for front-end developers that handle the complexity so you can relax.

Downloads

488

Readme

anshin (安心)

Peace of mind for React developers

npm stars TypeScript MIT

Documentationnpm

About

anshin is a React hooks library designed to give you peace of mind. The name comes from the Japanese word 安心 (anshin), which means "peace of mind" - the feeling that nothing needs your attention because things are handled.

✨ Features

  • 🎯 21+ Production-Ready Hooks - State, effects, UI, utilities, and network
  • 📦 Zero Dependencies - No bloat, just pure React goodness
  • 🔒 100% TypeScript - Full type safety and IntelliSense support
  • 🌳 Tree-Shakeable - Import only what you need
  • Fully Tested - Comprehensive test coverage
  • 📚 Well Documented - Clear examples and API references

🚀 Installation

npm install anshin
# or
yarn add anshin
# or
pnpm add anshin

📖 Quick Start

import { useCountdown, useClipboard, useBreakpoint } from 'anshin'

function App() {
  // Countdown timer
  const { count, start, pause, reset } = useCountdown({
    start: 60,
    target: 0
  })

  // Clipboard operations
  const { copy, isCopied } = useClipboard()

  // Responsive breakpoints
  const breakpoint = useBreakpoint()

  return (
    <div>
      <p>Time: {count}s</p>
      <p>Screen: {breakpoint}</p>
      <button onClick={() => copy('Hello!')}>
        {isCopied ? 'Copied!' : 'Copy'}
      </button>
    </div>
  )
}

🎣 Available Hooks

State Management

  • useVisibility - Toggle visibility states with callbacks
  • useStepper - Multi-step form/wizard state management

Side Effects

  • useLeavePage - Prevent accidental page navigation
  • useSpecializedEffect - Lifecycle-specific effects (mount, update, unmount)
  • useSelfUnmount - Component self-unmounting with conditions

UI & Interactions

  • useBreakpoint - Responsive breakpoint detection
  • useClickAway - Detect clicks outside elements
  • useMousePosition - Track mouse/pointer position
  • usePreventScroll - Lock/unlock body scroll
  • useTabTitle - Dynamic document title management

Utilities

  • useCountdown - Countdown/count-up timer
  • useDebounce - Debounce values and callbacks
  • useClipboard - Copy to clipboard with feedback
  • useDelay - Debounced delays and timeouts
  • useForceRerender - Force component re-render
  • useMultiTab - Detect multiple open tabs

Network & Browser

  • useGeoLocation - Get user's location
  • useFetchWithRetry - Fetch with retry logic
  • useScript - Dynamic script loading
  • useBattery - Battery status monitoring
  • useDetectIdle - Detect user idleness
  • useIncognito - Detect private browsing mode

📚 View Full Documentation →

💡 Philosophy

Every hook in this library embodies a simple promise: "I got you, relax dear developer."

We handle the complexity, edge cases, and boilerplate so you can focus on building great experiences.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-hook)
  3. Commit your changes (git commit -m 'Add amazing hook')
  4. Push to the branch (git push origin feature/amazing-hook)
  5. Open a Pull Request

📄 License

MIT © Kim Fajardo


Made with ❤️ by Kim Fajardo