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

@hm-soft/pii-detect

v0.1.0

Published

텍스트·로그에서 개인정보(주민번호·카드·전화·이메일) 탐지 및 자동 마스킹/라벨 치환 (의존성 0)

Readme

@hm-soft/pii-detect

텍스트·로그에서 개인정보(PII)를 탐지하고 가립니다. 주민번호·카드·전화·이메일. 로그 유출 방지, 사용자 입력 정제에. 의존성 0. @hm-soft/mask·@hm-soft/korean-validators와 보안 라인업.

설치

npm install @hm-soft/pii-detect

사용

import { detectPII, redactPII, hasPII } from "@hm-soft/pii-detect";

const text = "연락처 010-1234-5678, 메일 [email protected], 주민 901010-1234567";

detectPII(text);
// [ { type:"phone", value:"010-1234-5678", index:4, length:13 },
//   { type:"email", value:"[email protected]", ... },
//   { type:"rrn",   value:"901010-1234567", ... } ]

hasPII(text);                      // true

// 마스킹 (기본)
redactPII(text);
// "연락처 010-****-5678, 메일 a*@b.com, 주민 901010-1******"

// 라벨로 치환
redactPII(text, { mode: "label" });
// "연락처 [전화번호], 메일 [이메일], 주민 [주민등록번호]"

// 특정 종류만
detectPII(text, { types: ["email"] });

API

| 함수 | 설명 | |------|------| | detectPII(text, { types? }) | PII 위치 목록 { type, value, index, length } | | hasPII(text, { types? }) | PII 존재 여부 | | redactPII(text, { mode?, types?, maskChar?, labels? }) | 마스킹/라벨 치환 |

  • 탐지 종류: rrn(주민번호), card(카드), phone(전화/휴대폰), email
  • mode: "mask"(부분 가림, 기본) / "label"([주민등록번호] 등)
  • 겹치는 매치는 우선순위로 자동 정리

정규식 기반이라 100% 정밀하지는 않습니다(특히 변형 표기). 1차 방어선으로 사용하고, 저장 단계 암호화/해싱과 병행하세요.

License

Apache-2.0