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

idvalidator-id

v1.1.0

Published

Indonesia validators: NIK, NPWP, SIM, Passport, Postal Code, License Plate, plus global Phone/Email

Readme

idvalidator-id

Validators for Indonesia-specific structured data, plus the global Phone/Email validators, following the id-validator ecosystem's domain-first API: domain.validate(), .normalize(), .parse(), .format() (only where meaningful for that data type).

npm install idvalidator-id

Important

A valid: true result means the input matches the known structural rules this library implements. It does not confirm the identifier exists, is currently active, or is officially registered with any government system (Dukcapil, DJP, DMV, etc.). See the root ARCHITECTURE.md and REFERENCE.md for the full validation-vs-verification scope and per-validator limitations.

Usage

Framework integrations (Express, Zod, React): see the repo EXAMPLES.md.

import { nik, npwp, phone, postalCode, licensePlate, sim, passport } from "idvalidator-id";

nik.validate("3171051708900001");
// { valid: true, errors: [], value: "3171051708900001" }

nik.parse("3171051708900001");
// { provinceCode: "31", regencyCode: "71", districtCode: "05",
//   birthDate: "1990-08-17", gender: "male", sequence: "0001" }
// For real province/regency/district names, pass these codes to
// resolveAddress() from the optional @idvalidator/data-id-address package.

npwp.format("012345674000000");
// "01.234.567.4-000.000"

phone.validate("+62 812-3456-789");
// { valid: true, errors: [], value: "+628123456789" }

phone.validate("08123456789");        // local format, also accepted
phone.validate("0812-3456-789");      // with separators, also accepted
// both -> { valid: true, errors: [], value: "+628123456789" }

postalCode.validate("40115");
// { valid: true, errors: [], value: "40115" }

// Optional: province/regency/district lookup for a postal code
// npm install @idvalidator/data-id-address
// import { lookupPostalCode } from "@idvalidator/data-id-address";
// lookupPostalCode("40115"); // [{ provinceCode: "32", regencyCode: "73", districtCode: "09" }]

licensePlate.format("b1234xyz");
// "B 1234 XYZ"

sim.validate("123456789012");     // heuristic 12-digit check
passport.validate("C1234567");    // heuristic 1-letter + 7-digit check

What's implemented

| Validator | validate | normalize | parse | format | Status | | --- | :-: | :-: | :-: | :-: | --- | | nik | yes | yes | yes | yes | stable | | npwp | yes | yes | yes | yes | stable (legacy checksum is heuristic — see REFERENCE.md) | | phone (global) | yes | yes | yes | yes | stable | | licensePlate | yes | yes | yes | yes | stable | | postalCode | yes | yes | – | – | region lookup available via optional @idvalidator/data-id-address package | | sim | yes | – | – | – | heuristic (no consolidated public spec) | | passport | yes | yes | – | – | heuristic (no consolidated public spec) | | email (global) | yes | yes | yes | – | stable |

Full per-validator documentation: REFERENCE.md at the repo root.