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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@frontend-toolkit-js/hooks

v0.3.0

Published

React hooks for better DX with type safety

Readme

@frontend-toolkit/hooks

타입 안전하고 선언적인 React 훅 라이브러리

npm version License: MIT

설치

npm install @frontend-toolkit-js/hooks
# or
pnpm add @frontend-toolkit-js/hooks
# or
yarn add @frontend-toolkit-js/hooks

특징

  • ✅ TypeScript strict mode 100%
  • ✅ 제네릭으로 타입 자동 추론
  • ✅ Tree-shaking 지원
  • ✅ 자동 cleanup (메모리 누수 방지)

Hooks

useCalendar

달력 데이터와 네비게이션을 제공합니다. UI는 완전히 사용자가 제어합니다.

import { useCalendar } from '@frontend-toolkit/hooks';

function Calendar() {
  const cal = useCalendar({ weekStartsOn: 1 }); // 월요일 시작

  return (
    <div>
      <button onClick={cal.prev}>◀</button>
      <h2>{cal.currentDate.toLocaleDateString('ko-KR')}</h2>
      <button onClick={cal.next}>▶</button>

      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(7, 1fr)' }}>
        {cal.days.map((day, i) => (
          <div
            key={i}
            style={{
              opacity: day.isCurrentMonth ? 1 : 0.3,
              fontWeight: day.isToday ? 'bold' : 'normal',
            }}
          >
            {day.day}
          </div>
        ))}
      </div>
    </div>
  );
}

옵션: defaultDate, weekStartsOn (0=일요일, 1=월요일)

반환값: days, weekdays, currentDate, prev, next, today, setDate

전체 API 문서 →

개발 예정

  • useDebounce - 디바운스된 값 반환
  • useBoolean - boolean 상태 관리
  • useLocalStorage - 타입 안전한 localStorage
  • useFetch - 선언적 데이터 페칭

TypeScript

모든 훅은 TypeScript로 작성되었으며 타입이 자동으로 추론됩니다.

const cal = useCalendar();
//    ^? { days: CalendarDay[], weekdays: Weekday[], ... }

브라우저 지원

  • 모던 브라우저 (ES2020+)
  • React 18+

라이선스

MIT © rak517

링크