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

jurunghappy-hooks

v0.0.8

Published

npm modules

Downloads

2

Readme

Hooks Module

소개

카드 등록 시 필요한 입력 값에 대한 유효성 검사를 진행할 수 있는 훅입니다.

설치 방법

npm install jurunghappy-hooks

주요 hooks

  • useCardNumbers : 카드 번호 유효성 검증할 수 있습니다.
  • useExpiryDate : 카드 유효 날짜 유효성 검증할 수 있습니다.
  • useCvcNumber : 카드 CVC 번호 유효성 검증할 수 있습니다.
  • usePassword : 카드 비밀번호 2자리 검증할 수 있습니다.

사용 예시

useCardNumbers

  • formattedNumber : 카드사별로 포맷팅된 카드 번호
  • cardBrand : 카드사
  • error : isValid(boolean)와 errorMassage(string)를 담고 있는 객체
  • handleCardNumbers : numbers 상태 업데이트 및 유효성 검증 함수
import { useCardNumbers } from 'jurunghappy-hooks';

function App() {
  const {
    formattedNumber,
    cardBrand,
    error: cardNumbersError,
    handleCardNumbers,
  } = useCardNumbers();

  return (
    <>
      <div>
        <h1>CardNumbers</h1>
        <input
          type="text"
          value={formattedNumber}
          onChange={(e) => handleCardNumbers(e.target.value)}
        />
        <p>{cardBrand ? cardBrand : ''}</p>
        <p>{cardNumbersError.errorMessage}</p>
      </div>
    </>
  );
}

export default App;

useExpiryDate

  • date : {month: string, year: string} 객체
  • error : isValid(boolean)와 errorMassage(string)를 담고 있는 객체 배열
  • handleExpiryDate : date 상태 업데이트 및 유효성 검증 함수
import { useExpiryDate } from 'jurunghappy-hooks';

function App() {
  const { date, error: dateError, useExpiryDate } = useExpiryDate();

  return (
    <>
      <div>
        <h1>Date</h1>
        <input
          type="text"
          value={date.month}
          name="month"
          onChange={(e) => useExpiryDate(e, 'month')}
        />
        <p>{dateError[0].errorMessage}</p>
        <input
          type="text"
          value={date.year}
          name="year"
          onChange={(e) => useExpiryDate(e, 'year')}
        />
        <p>{dateError[1].errorMessage}</p>
      </div>
    </>
  );
}

export default App;

useCvcNumber

  • cvc : 카드 cvc 번호 (string)
  • error : isValid(boolean)와 errorMassage(string)를 담고 있는 객체
  • handleCvc : cvc 상태 업데이트 및 유효성 검증 함수
import './App.css';
import { useCvcNumber } from 'jurunghappy-hooks';

function App() {
  const { cvc, error: cvcError, handleCvc } = useCvcNumber();

  return (
    <>
      <div>
        <h1>CVC</h1>
        <input type="text" value={cvc} onChange={(e) => handleCvc(e)} />
        <p>{cvcError.errorMessage}</p>
      </div>
    </>
  );
}

export default App;

usePassword

  • password : 카드 비밀번호 2자리 (string)
  • error : isValid(boolean)와 errorMassage(string)를 담고 있는 객체
  • handlePassword : password 상태 업데이트 및 유효성 검증 함수
import { usePassword } from 'jurunghappy-hooks';

function App() {
  const { password, error: passwordError, handlePassword } = usePassword();

  return (
    <>
      <div>
        <h1>Password</h1>
        <input
          type="text"
          value={password}
          onChange={(e) => handlePassword(e)}
        />
        <p>{passwordError.errorMessage}</p>
      </div>
    </>
  );
}

export default App;