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

myanmar-areas

v1.1.2

Published

Myanmar administrative areas data in JavaScript

Readme

Myanmar Administrative Areas

A JavaScript library providing data about Myanmar's administrative areas, including divisions/states, districts, townships, towns, villages, and wards in both English and Myanmar languages.

Installation

npm install myanmar-areas

Usage (ဟိုးအောက်မှာ JavaScript/React usage ရှိတယ်)

// Import the entire library
const myanmar = require('myanmar-areas');

// Or import specific data sets
const {
  divisionEn,
  divisionMy,
  districtsEn,
  districtsMy,
  townshipsAsDivisionEn,
  townshipsAsDivisionMy,
  townsAsDivisionEn,
  townsAsDivisionMy,
  townsAsDistrictEn,
  townsAsDistrictMy,
  townsAsTownshipEn,
  townsAsTownshipMy,
  villagesAsTownshipEn,
  villagesAsTownshipMy,
  villagesAsDistrictEn,
  villagesAsDistrictMy,
  wardsEn,
  wardsMy,
} = require('myanmar-areas');

// Get all divisions/states in English
console.log(divisionEn);
// ['Kachin', 'Kayah', 'Kayin', ...]

// Get all divisions/states in Myanmar language
console.log(divisionMy);
// ['ကချင်ပြည်နယ်', 'ကယားပြည်နယ်', 'ကရင်ပြည်နယ်', ...]

// Get districts of a specific division/state in English
console.log(districtsEn['Yangon']);
// ['Yangon (North)', 'Yangon (East)', 'Yangon (South)', 'Yangon (West)']

// Get districts of a specific division/state in Myanmar language
console.log(districtsMy['ရန်ကုန်တိုင်းဒေသကြီး']);
// ['ရန်ကုန်(မြောက်ပိုင်း)', 'ရန်ကုန်(အရှေ့ပိုင်း)', 'ရန်ကုန်(တောင်ပိုင်း)', 'ရန်ကုန်(အနောက်ပိုင်း)']

// Get townships of a specific division/state in English
console.log(townshipsAsDivisionEn['Yangon']);
// ['Ahlone', 'Bahan', 'Botahtaung', ...]

// Get town names by division/state
console.log(townsAsDivisionEn['Ayeyarwady'].slice(0, 5));
// ['Bogale Town', 'Danubyu Town', ...]

// Get town names by district
console.log(townsAsDistrictEn['Mandalay'].slice(0, 5));
// ['Amarapura', 'Aungmyaythazan', ...]

// Get town names by township
console.log(townsAsTownshipEn['Pathein']);
// ['Pathein Town', 'Chaung Thar Town', 'Ngwesaung Town', ...]

// Get village names by township
console.log(villagesAsTownshipEn['Bogale'].slice(0, 5));
// ['Kyun Hteik', 'Auk Hle Seik', ...]

// Get village names by district
console.log(villagesAsDistrictEn['Pathein'].slice(0, 5));
// ['Bogale', 'Danubyu', ...]

// Get wards by town (English)
console.log(wardsEn['Pathein Town']);
// ['Aye Mya Thar Yar Ward', 'Boe Yar Nyunt Ward', ...]

// မြန်မာလို ဖတ်ချင်ရင် (Myanmar language examples)
console.log(townshipsAsDivisionMy['ရန်ကုန်']);
// ['အလုံ', 'ဗဟန်း', 'ဗိုလ်တထောင်', ...]
console.log(wardsMy['ပုသိမ်']);
// ['အေးမြသာရာ ရပ်ကွက်', 'ဗိုးရာညွန့် ရပ်ကွက်', ...]

// Helper: Drill down from Division -> Districts -> Townships -> Towns -> Villages -> Wards
const division = 'Yangon';
const districts = districtsEn[division] || [];
const firstDistrict = districts[0];
const townships = townshipsAsDivisionEn[division] || [];
const firstTownship = townships[0];
const towns = townsAsTownshipEn[firstTownship] || [];
const firstTown = towns[0];
const wards = wardsEn[firstTown] || [];
console.log({ division, firstDistrict, firstTownship, firstTown, wards });

Available Data

  • Divisions/States

    • divisionEn: List of divisions/states in English
    • divisionMy: List of divisions/states in Myanmar language
  • Districts

    • districtsEn: Map of districts by division/state in English
    • districtsMy: Map of districts by division/state in Myanmar language
  • Townships

    • townshipsAsDivisionEn: Map of townships by division/state in English
    • townshipsAsDivisionMy: Map of townships by division/state in Myanmar language
  • Towns

    • townsAsDivisionEn: Map of towns by division/state in English
    • townsAsDivisionMy: Map of towns by division/state in Myanmar language
    • townsAsDistrictEn: Map of towns by district in English
    • townsAsDistrictMy: Map of towns by district in Myanmar language
    • townsAsTownshipEn: Map of towns by township in English
    • townsAsTownshipMy: Map of towns by township in Myanmar language
  • Villages

    • villagesAsTownshipEn: Map of villages by township in English
    • villagesAsTownshipMy: Map of villages by township in Myanmar language
    • villagesAsDistrictEn: Map of villages by district in English (simplified)
    • villagesAsDistrictMy: Map of villages by district in Myanmar language (simplified)
  • Wards

    • wardsEn: Map of wards by town in English (simplified)
    • wardsMy: Map of wards by town in Myanmar language (simplified)

UI Usage (React)

ဒီနမူနာတွေက Flutter example ကို JavaScript/React နဲ့ တူညီစွာရေးထားတာဖြစ်ပြီး Division → Township → Village/Town → Ward အတိုင်းရွေးချယ်နိုင်ပါတယ်။

Village Example (Division → Township → Village)

import React, { useState } from 'react';
import {
  divisionMy,
  townshipsAsDivisionMy,
  villagesAsTownshipMy
} from 'myanmar-areas';

export default function VillageExample() {
  const [division, setDivision] = useState('');
  const [township, setTownship] = useState('');
  const [village, setVillage] = useState('');

  const townships = division ? (townshipsAsDivisionMy[division] || []) : [];
  const villages = township ? (villagesAsTownshipMy[township] || []) : [];

  return (
    <div style={{ padding: 24, maxWidth: 500 }}>
      <h2>ကျေးရွာ နမူနာ</h2>

      <select
        value={division}
        onChange={e => { setDivision(e.target.value); setTownship(''); setVillage(''); }}
      >
        <option value="">ပြည်နယ် နှင့် တိုင်းရွေးပါ</option>
        {divisionMy.map(d => (<option key={d} value={d}>{d}</option>))}
      </select>

      {townships.length > 0 && (
        <select
          value={township}
          onChange={e => { setTownship(e.target.value); setVillage(''); }}
          style={{ display: 'block', marginTop: 12 }}
        >
          <option value="">မြို့နယ်ရွေးပါ</option>
          {townships.map(t => (<option key={t} value={t}>{t} မြို့နယ်</option>))}
        </select>
      )}

      {villages.length > 0 && (
        <select
          value={village}
          onChange={e => setVillage(e.target.value)}
          style={{ display: 'block', marginTop: 12 }}
        >
          <option value="">ကျေးရွာ ရွေးချယ်ပါ</option>
          {villages.map(v => (<option key={v} value={v}>{v} ကျေးရွာ</option>))}
        </select>
      )}

      {division && township && village && (
        <div style={{ marginTop: 16, fontSize: 16 }}>
          {division}<br />
          {township} မြို့နယ်<br />
          {village} ကျေးရွာ
        </div>
      )}
    </div>
  );
}

Ward Example (Division → Township → Town → Ward)

import React, { useState } from 'react';
import {
  divisionMy,
  townshipsAsDivisionMy,
  townsAsTownshipMy,
  wardsMy
} from 'myanmar-areas';

export default function WardExample() {
  const [division, setDivision] = useState('');
  const [township, setTownship] = useState('');
  const [town, setTown] = useState('');
  const [ward, setWard] = useState('');

  const townships = division ? (townshipsAsDivisionMy[division] || []) : [];
  const towns = township ? (townsAsTownshipMy[township] || []) : [];
  const wards = town ? (wardsMy[town] || []) : [];

  return (
    <div style={{ padding: 24, maxWidth: 500 }}>
      <h2>ရပ်ကွက် နမူနာ</h2>

      <select
        value={division}
        onChange={e => { setDivision(e.target.value); setTownship(''); setTown(''); setWard(''); }}
      >
        <option value="">ပြည်နယ် နှင့် တိုင်းရွေးပါ</option>
        {divisionMy.map(d => (<option key={d} value={d}>{d}</option>))}
      </select>

      {townships.length > 0 && (
        <select
          value={township}
          onChange={e => { setTownship(e.target.value); setTown(''); setWard(''); }}
          style={{ display: 'block', marginTop: 12 }}
        >
          <option value="">မြို့နယ်ရွေးပါ</option>
          {townships.map(t => (<option key={t} value={t}>{t} မြို့နယ်</option>))}
        </select>
      )}

      {towns.length > 0 && (
        <select
          value={town}
          onChange={e => { setTown(e.target.value); setWard(''); }}
          style={{ display: 'block', marginTop: 12 }}
        >
          <option value="">မြို့ရွေးပါ</option>
          {towns.map(t => (<option key={t} value={t}>{t} မြို့</option>))}
        </select>
      )}

      {wards.length > 0 && (
        <select
          value={ward}
          onChange={e => setWard(e.target.value)}
          style={{ display: 'block', marginTop: 12 }}
        >
          <option value="">ရပ်ကွက်ရွေးပါ</option>
          {wards.map(w => (<option key={w} value={w}>{w} ရပ်ကွက်</option>))}
        </select>
      )}

      {division && township && town && ward && (
        <div style={{ marginTop: 16, fontSize: 16 }}>
          {division}<br />
          {township} မြို့နယ်<br />
          {town} မြို့<br />
          {ward} ရပ်ကွက်
        </div>
      )}
    </div>
  );
}

Quick start (Vite React):

npm create vite@latest my-app -- --template react
cd my-app
npm install
npm install myanmar-areas

src/App.jsx

import React from 'react';
import VillageExample from './VillageExample';
import WardExample from './WardExample';

export default function App() {
  return (
    <div style={{ display: 'grid', gap: 24 }}>
      <VillageExample />
      <WardExample />
    </div>
  );
}

License

MIT