Getting started
-
Install the package. Go 1.25 or later uses only the standard library. TypeScript runs on Node.js 22.18 or later, Bun, Deno, edge runtimes and modern browsers (ESM only).
Go go get github.com/haikalmumtaz233/nusaindexTypeScript npm install nusaindex -
Run a first check. This example runs on every build, in both languages, and must print the same output.
package mainimport ("fmt""github.com/haikalmumtaz233/nusaindex/nik""github.com/haikalmumtaz233/nusaindex/phone""github.com/haikalmumtaz233/nusaindex/rupiah")func main() {person, err := nik.Parse("3273275705901349")if err == nil {fmt.Println(person.BirthDate, person.Sex)}mobile, err := phone.Parse("0859-5257-171")if err == nil {fmt.Println(mobile.E164, mobile.Brand)}words, err := rupiah.Terbilang(1_500_000*rupiah.Rupiah + 50*rupiah.Sen)if err == nil {fmt.Println(words)}}import * as nik from "nusaindex/nik";import * as phone from "nusaindex/phone";import * as rupiah from "nusaindex/rupiah";const person = nik.parse("3273275705901349");if (person.ok) {console.log(person.value.birthDate, person.value.sex);}const mobile = phone.parse("0859-5257-171");if (mobile.ok) {console.log(mobile.value.e164, mobile.value.brand);}const words = rupiah.terbilang(1_500_000.5);if (words.ok) {console.log(words.value);}Output 1990-05-17 female+628595257171 XLsatu juta lima ratus ribu rupiah lima puluh sen -
Import only what you need. Each module is its own Go package (
github.com/haikalmumtaz233/nusaindex/<name>) and TypeScript subpath (nusaindex/<name>).nusaindex/nikadds less than 2 KB gzip to a browser bundle, and region data loads one province at a time.
Modules
Section titled “Modules”Identifiers
Reference data
Utilities
Same API, two languages
Section titled “Same API, two languages”| Operation | Go | TypeScript |
|---|---|---|
| Quick check | Valid(s) bool |
isValid(s): boolean |
| Parse | Parse(s) (T, error) |
parse(s): Result<T> |
| Normalize | Format(s) (string, error) |
format(s): Result<string> |
| Mask | Mask(s) string |
mask(s): string |
Names follow each language (WhatsAppLink, whatsappLink). Shared test vectors run against both implementations, so results are identical. In TypeScript, fake, zod and valibot are subpath-only.
Next steps
Section titled “Next steps”- Results and errors: how failures are reported.
- Input and privacy: accepted characters, Unicode, and masking.
- Command line and MCP server if you are not writing code.
© 2026 Haikal Mumtaz