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

vietnam-address-data

v1.0.0

Published

Normalized Vietnamese administrative data (provinces & wards) with TypeScript support and search utilities. Updated for the 2025 administrative restructuring.

Readme

Vietnam Address Data 🇻🇳

Normalized Vietnamese administrative data — provinces & wards — with full TypeScript support and Vietnamese-aware search utilities.

Updated for the 2025 administrative restructuring (effective 01/07/2025), following the merger of administrative units under Resolution 1171/NQ-UBTVQH15.

npm version TypeScript License: MIT


✨ Features

  • 📦 Normalized data — flat Province[] and Ward[] arrays, no nested structures
  • 🔷 Full TypeScript support — types and .d.ts declarations included out of the box
  • 🔍 Vietnamese-aware search — diacritic-insensitive partial matching ("hoan kiem" matches "Hoàn Kiếm")
  • Zero runtime dependencies — lightweight, pure data + utilities
  • 🇻🇳 2025 data — reflects the latest administrative restructuring across all provinces

📦 Installation

npm install vietnam-address-data
yarn add vietnam-address-data
pnpm add vietnam-address-data

🚀 Usage

Import data

import { provinces, wards } from 'vietnam-address-data'

// All provinces
console.log(provinces)
// [
//   { id: "01", name: "Hà Nội" },
//   { id: "02", name: "Bắc Ninh" },
//   ...
// ]

// All wards
console.log(wards)
// [
//   { id: "10105001", name: "Phường Hoàn Kiếm", provinceId: "01" },
//   { id: "10105002", name: "Phường Cửa Nam",   provinceId: "01" },
//   ...
// ]

Search for wards

import { findWard } from 'vietnam-address-data'

// Works with Vietnamese diacritics
findWard("Hoàn Kiếm")
// => [{ id: "10105001", name: "Phường Hoàn Kiếm", provinceId: "01" }]

// Also works without diacritics (partial match)
findWard("hoan kiem")
// => [{ id: "10105001", name: "Phường Hoàn Kiếm", provinceId: "01" }]

// Partial match
findWard("ba dinh")
// => [{ id: "10101003", name: "Phường Ba Đình", provinceId: "01" }]

Search for provinces

import { findProvince } from 'vietnam-address-data'

findProvince("hà nội")
// => [{ id: "01", name: "Hà Nội" }]

findProvince("thanh")
// => provinces containing "thanh" (e.g. Thanh Hoá, Thanh Hóa, ...)

Get wards by province

import { getWardsByProvince } from 'vietnam-address-data'

const hanoiWards = getWardsByProvince("01")
// => all wards in Hà Nội

Normalize Vietnamese text

import { normalizeVietnamese } from 'vietnam-address-data'

normalizeVietnamese("Phường Hoàn Kiếm")
// => "phuong hoan kiem"

normalizeVietnamese("  Đà Nẵng  ")
// => "da nang"

TypeScript types

import type { Province, Ward } from 'vietnam-address-data'

const myProvince: Province = { id: "01", name: "Hà Nội" }

const myWard: Ward = {
  id: "10105001",
  name: "Phường Hoàn Kiếm",
  provinceId: "01"
}

📐 Data Schema

Province

| Field | Type | Description | |-------|--------|----------------------------------------| | id | string | 2-digit BNV province code, zero-padded | | name| string | Province name (Vietnamese, no prefix) |

Ward

| Field | Type | Description | |--------------|--------|-------------------------------------------| | id | string | 8-digit ward code, zero-padded | | name | string | Ward name (Vietnamese, with type prefix) | | provinceId | string | Parent province ID |


🔧 API Reference

findWard(keyword: string): Ward[]

Search wards by name. Case-insensitive, diacritic-insensitive, partial match.

findProvince(keyword: string): Province[]

Search provinces by name. Case-insensitive, diacritic-insensitive, partial match.

getWardsByProvince(provinceId: string): Ward[]

Return all wards belonging to a province.

normalizeVietnamese(text: string): string

Remove Vietnamese diacritics, lowercase, and trim. Useful for building your own search or comparison logic.


🗺️ Roadmap

  • [ ] District-level data (quận/huyện) as an intermediate layer
  • [ ] Lookup by old code (pre-2025 → post-2025 mapping)
  • [ ] ESM build (dist/index.esm.js)
  • [ ] CDN/browser-ready bundle
  • [ ] Postal code mapping

📚 Data Source


🤝 Contributing

Pull requests are welcome! If you find data inaccuracies or have suggestions, please open an issue.


📄 License

MIT © phucanhle