Skip to content

An npm package for Node.js to access detailed geographic data on Thailand, including provinces, districts, and subdistricts. 🌟

License

Notifications You must be signed in to change notification settings

GeoThai/npm-packages

Repository files navigation

GeoThai NPM Packages

NPM Version License

Welcome to the GeoThai NPM Packages repository! 🌟 This repository provides an npm package for Node.js that allows you to retrieve detailed geographic data of provinces, districts, subdistricts, and postal code in Thailand.

📦 Overview

This package includes functions to access and retrieve data about:

  • Provinces
  • Districts
  • Subdistricts
  • Postal Code

The data is sourced from comprehensive JSON files included in the package.

📊 Features

  • Retrieve All Provinces: Fetch a list of all provinces in Thailand.
  • Retrieve Province by ID: Get details of a specific province using its ID.
  • Retrieve All Districts: Fetch a list of all districts.
  • Retrieve District by ID: Get details of a specific district using its ID.
  • Retrieve All Subdistricts: Fetch a list of all subdistricts.
  • Retrieve Subdistrict by ID: Get details of a specific subdistrict using its ID.
  • Retrieve All Postal Codes: Fetch a list of all postal codes.
  • Retrieve Postal Code by Code: Get details of a specific postal code using its code.
  • Filter by Criterion: Retrieve entities based on specific criteria.

🚀 Installation

You can install the package via npm:

npm install geothai

🛠️ Usage

Here’s a quick guide on how to use the package:

import { getAllProvinces, getProvinceById, getProvincesByCriterion } from 'geothai'

// Retrieve all provinces
const provinces = getAllProvinces()
console.log(provinces)

// Retrieve a single province by ID
const province = getProvinceById(10)
console.log(province)

// Retrieve provinces by a specific criterion
const filteredProvinces = getProvincesByCriterion({ th: 'กรุงเทพมหานคร' })
console.log(filteredProvinces)

🤝 Contributing

We welcome contributions to enhance this package. Please follow the guidelines in the CONTRIBUTING.md file.

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

🙋‍♂️ Contact

For any questions or support, please open an issue or contact us at pyyupsk@proton.me.

Happy coding! 🎉

About

An npm package for Node.js to access detailed geographic data on Thailand, including provinces, districts, and subdistricts. 🌟

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks