Socket
Book a DemoInstallSign in
Socket

ua-location

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ua-location

Easily navigate and query Ukrainian administrative divisions, including **Oblasts**, **Raions**, **Hromadas**, and **Settlements**.

1.0.3
latest
npmnpm
Version published
Weekly downloads
12
100%
Maintainers
1
Weekly downloads
 
Created
Source

ua-location npm

Easily navigate and query Ukrainian administrative divisions, including Oblasts, Raions, Hromadas, and Settlements.

Features

  • Search by name or ISO code.
  • Provides hierarchical traversal (Oblast → Raion → Hromada → Settlement).
  • Expose English and Ukrainian labels and geolocation.
  • Works in both frontend and backend environments.
  • Settlements are lazy loaded via Promise.
  • Typing support of ISO Code.

Installation

npm install ua-location

Usage Example

import {UaLocation} from 'ua-location'

// Get Raion's information
const raion = UaLocation.Raion.findByIso('UA0102')
raion.en        // Bakhchysaraiskyi
raion.ua        // Бахчисарайський
raion.hromadas  // UaLocation.Hromada[]
raion._5w       // Bakhchysaraiskyi_Бахчисарайський
raion.loc       // [ 44.65944872, 33.83442735 ]
raion.oblast    // UaLocation.Oblast (Autonomous Republic of Crimea)

// Get all Hromadas of a given Oblast
const hromadas = UaLocation.Oblast.findByName('Chernihivska').raions.flatMap(_ => _.hromadas)

// Search for a Settlement
const settlement = await UaLocation.Oblast.findByName('Dnipropetrovska')
  .raions.find(_ => _.en.includes('Cherni'))
  ?.hromadas.find(_ => _.en.includes('Cherni'))
  ?.getSettlements().then(_ => _.find(_ => _.en.includes('Cherni'))?.en) // Chernihiv

// Get Oblast ISO of a Settlement reference
const oblast = settlement.hromada.raion.oblast.iso

// Get Hromada's name by ISO
const hromada = UaLocation.Hromada.findByIso('UA0102003').en // Aromatnenska

FAQs

Package last updated on 03 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.