πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Book a DemoInstallSign in
Socket

auto-hyphen-utils

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-hyphen-utils

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

1.0.2
latest
Source
npm
Version published
Weekly downloads
617
-67.93%
Maintainers
0
Weekly downloads
Β 
Created
Source

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)}
        />
      )}
    />
  );
};

Keywords

hyphen

FAQs

Package last updated on 18 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts