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

hududlar

v1.0.2

Published

O'zbekiston hududlari: viloyatlar, tumanlar, qishloqlar uchun TypeScript kutubxonasi

Readme

📦 hududlar

O'zbekiston hududiy ma'lumotlar kutubxonasi: viloyatlar, tumanlar va qishloqlarni TypeScript yordamida osongina olish.


✨ Imkoniyatlar

  • getRegions() – barcha viloyatlarni olish
  • getDistrictsByRegionId(regionId) – viloyatga tegishli tumanlar
  • getVillagesByDistrictId(districtId) – tumanga tegishli qishloqlar
  • findRegionById(id) – ID bo‘yicha viloyat
  • findDistrictById(id) – ID bo‘yicha tuman
  • findVillageById(id) – ID bo‘yicha qishloq
  • getRegionTree() – viloyat → tuman → qishloq daraxti shaklida

🚀 O‘rnatish

npm install hududlar
# yoki
yarn add hududlar

📦 Foydalanish

1. Barcha viloyatlarni olish

import { getRegions } from 'hududlar'

const regions = getRegions()
console.log(regions[0].name_uz) // "Andijon viloyati"

2. Viloyatga tegishli tumanlar

import { getDistrictsByRegionId } from 'hududlar'

const districts = getDistrictsByRegionId(2)
console.log(districts.map(d => d.name_uz))

3. Tumanga tegishli qishloqlar

import { getVillagesByDistrictId } from 'hududlar'

const villages = getVillagesByDistrictId(16)
console.log(villages.length) // 13

4. To‘liq daraxt ko‘rinishi (viloyat → tuman → qishloq)

import { getRegionTree } from 'hududlar'

const tree = getRegionTree()
console.log(tree[0].districts[0].villages)

5. ID bo‘yicha topish

import {
  findRegionById,
  findDistrictById,
  findVillageById
} from 'hududlar'

const region = findRegionById(2)
const district = findDistrictById(16)
const village = findVillageById(217)

🧱 Tiplar

interface Region {
  id: number
  soato_id: number
  name_uz: string
  name_oz: string
  name_ru: string
}

interface District {
  id: number
  region_id: number
  soato_id: number
  name_uz: string
  name_oz: string
  name_ru: string
}

interface Village {
  id: number
  district_id: number
  soato_id: number
  name_uz: string
  name_oz: string
  name_ru: string
}

💡 Advanced

getRegionTree() funksiyasi quyidagi tuzilmani qaytaradi:

{
  id: number
  name_uz: string
  ...
  districts: [
    {
      id: number
      name_uz: string
      ...
      villages: [
        {
          id: number
          name_uz: string
          ...
        }
      ]
    }
  ]
}

📄 Litsenziya

MIT © Akbar Iskanderov

🤝 Hissa qo‘shish

Pull request yoki issue ochish orqali takliflaringizni yuboring.
O‘zbekiston hududiy ma'lumotlarini ochiq va sifatli qilishga birga hissa qo‘shamiz!