https://github.com/do-kevin/pc-vn
Helper to get provinces, cities, wards of Vietnam
https://github.com/do-kevin/pc-vn
district javascript localities province vietnam ward
Last synced: 8 months ago
JSON representation
Helper to get provinces, cities, wards of Vietnam
- Host: GitHub
- URL: https://github.com/do-kevin/pc-vn
- Owner: do-kevin
- License: mit
- Created: 2021-07-19T09:05:14.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-16T02:36:00.000Z (over 2 years ago)
- Last Synced: 2025-02-09T20:04:37.049Z (8 months ago)
- Topics: district, javascript, localities, province, vietnam, ward
- Language: TypeScript
- Homepage: https://do-kevin.github.io/pc-vn/
- Size: 458 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @do-kevin/pc-vn
Type-safe & simple utility library for searching and filtering Vietnam's localities.
## Documentation
Visit the [official documentation](https://do-kevin.github.io/pc-vn).
## Install
npm install @do-kevin/pc-vn
yarn install @do-kevin/pc-vn## Functions
| Function | Desciption |
| ---------------------------------------- | --------------------------------------------------- |
| getProvinces() | Get all provinces |
| getDistricts() | Get all districts |
| getWards() | Get all wards |
| getDistrictsByProvinceCode(provinceCode) | Get districts by province code(from getProvinces()) |
| getWardsByDistrictCode(districtCode) | Get wards by district code(from getDistricts()) |
| getWardsByProvinceCode(provinceCode) | Get wards by province code(from getProvinces()) |## Usage
```
import {
getDistrictsByProvinceCode,
getProvinces,
getWardsByDistrictCode,
} from '@do-kevin/pc-vn';const provinces = getProvinces();
const wards = getWardsByDistrictCode("268");
const districts = getDistrictsByProvinceCode("95");
```