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

ja-form-validators

v0.1.0

Published

Tiny TypeScript validators for Japanese form inputs.

Readme

ja-form-validators

Tiny TypeScript validators for Japanese form inputs.

  • 郵便番号
  • 携帯電話番号
  • 日本の電話番号っぽい形式
  • 全角カタカナ
  • 全角文字

Install

npm install ja-form-validators

Usage

import {
  isPostalCodeJP,
  isMobilePhoneJP,
  isPhoneNumberJP,
  isKatakana,
  isZenkaku,
} from "ja-form-validators"

isPostalCodeJP("150-0001")
// true

isMobilePhoneJP("090-1234-5678")
// true

isKatakana("タナカ タロウ")
// true

API

isPostalCodeJP(value: string): boolean

Checks whether the value is a Japanese postal code.

isPostalCodeJP("150-0001") // true
isPostalCodeJP("1500001")  // true
isPostalCodeJP("150-0001") // false

isMobilePhoneJP(value: string): boolean

Checks whether the value is a Japanese mobile phone number starting with 070, 080, or 090.

isMobilePhoneJP("090-1234-5678") // true
isMobilePhoneJP("08012345678")   // true
isMobilePhoneJP("03-1234-5678")  // false

isPhoneNumberJP(value: string): boolean

Checks whether the value looks like a Japanese phone number.

This is intentionally lightweight and not a complete phone-number parser.

isPhoneNumberJP("03-1234-5678")  // true
isPhoneNumberJP("090-1234-5678") // true

isKatakana(value: string): boolean

Checks whether the value contains only full-width katakana, spaces, long vowel marks, and middle dots.

isKatakana("タナカ") // true
isKatakana("タナカ タロウ") // true
isKatakana("たなか") // false

isZenkaku(value: string): boolean

Checks whether the value does not include ASCII half-width characters.

isZenkaku("山田太郎") // true
isZenkaku("山田Taro") // false

Works great with normalize-ja-input

This library does not normalize input.

If you want to normalize full-width digits, spaces, or hyphen-like characters before validation, use it with normalize-ja-input.

import { normalizeJaInput } from "normalize-ja-input"
import { isMobilePhoneJP } from "ja-form-validators"

const value = normalizeJaInput("090ー1234ー5678")

isMobilePhoneJP(value)
// true

Design policy

ja-form-validators only validates strings.


Live Demo

  • Demo → https://fusaihanabi.github.io/ja-form-validators/
  • npm → https://www.npmjs.com/package/ja-form-validators
  • GitHub → https://github.com/fusaihanabi/ja-form-validators
  • Official → https://dl.fusai-hanabi.com

It does not:

  • normalize input
  • format values
  • parse addresses
  • validate emails or URLs

License

MIT