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

auto-hyphen-utils

v1.0.2

Published

This module provides automatic formatting and hyphenation for structured inputs with a similar pattern.

Downloads

2,263

Readme

auto-hyphen-utils

NPM Version License Build Status Bundle Size Downloads

입력값을 자동으로 하이픈 처리하는 JavaScript 유틸리티 라이브러리 전화번호, 주민등록번호, 사업자등록번호 등 다양한 입력값을 자동으로 변환할 수 있습니다.


⚡ Lightweight & High Performance

🚀 고성능 및 저용량으로 최적화된 유틸리티 라이브러리입니다.

  • 가볍고 빠름: 패키지 크기가 작아 성능에 영향을 주지 않음
  • Zero Dependencies: 외부 의존성이 없어 유지보수가 쉬움
  • 정규 표현식 기반 최적화: 빠르고 안정적인 하이픈 변환 가능

👋🏻 Installation

npm install auto-hyphen-utils
yarn add auto-hyphen-utils
pnpm add auto-hyphen-utils

🎯 Usage

📖 utils

- 특정 패턴을 지정해 하이픈을 넣어줘요
autoHyphen.common(value: string, pattern: number[])
console.log(autoHyphen.common("1234567890")); // "1234567890"
console.log(autoHyphen.common("1234567890", [3, 6])); // "123-456-7890"

⸻

- 한국 전화번호(휴대폰 및 유선전화)에 맞춰 하이픈을 넣어줘요
autoHyphen.phoneNumber(value: string)
console.log(autoHyphen.phoneNumber("01012345678")); // "010-1234-5678"
console.log(autoHyphen.phoneNumber("0212345678"));  // "02-1234-5678"

⸻
- 사업자등록번호(TIN, Taxpayer Identification Number)에 맞춰 하이픈을 넣어줘요
autoHyphen.tinNumber(value: string)
console.log(autoHyphen.tinNumber("1234567890")); // "123-45-67890"

🛠 Integrating auto-hyphen-utils with React Hook Form


import { Controller, useForm } from 'react-hook-form';
import autoHyphen from 'auto-hyphen-utils';

const PhoneInput = () => {
  const { control } = useForm();

  return (
    <Controller
      name="phone"
      control={control}
      render={({ field }) => (
        <input
          {...field}
          placeholder="전화번호 입력"
          value={autoHyphen.phoneNumber(field.value)}
          onChange={(e) => field.onChange(e.target.value)}
        />
      )}
    />
  );
};