Skip to content

ฐานข้อมูลที่อยู่ในไทย ไม่ต้องใช้ Server Side!

Notifications You must be signed in to change notification settings

Sellsuki/thai-address-database

This branch is 145 commits ahead of, 55 commits behind earthchie/jquery.Thailand.js:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f78a7e3 · Oct 30, 2024
Apr 14, 2020
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Dec 20, 2017
Jul 27, 2017
Jul 27, 2017
Jul 27, 2017
Dec 28, 2017
Jan 4, 2018
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Dec 28, 2017
Oct 30, 2024

Repository files navigation

Build Status Maintainability Test Coverage

thai-address-database

ฐานข้อมูลที่อยู่ในไทย ไม่ต้องใช้ Server Side!

Original Version

database และ function preprocess() จาก ตั้นฉบับ version 1.5.1

[Commit: 4e5f496]

ข้อจำกัด

  • ตอนนี้รองรับแค่ db.json
  • ยังไม่รองรับ db.zip
  • ยังไม่รองรับ geodb

Example

yarn add thai-address-database
<template>
  <div id="app">
    <input v-model="q">
    <ul>
      <li v-for="item in result">
        {{item.district}} » {{item.amphoe}} » {{item.province}} » {{item.zipcode}}
      </li>
    </ul>
  </div>
</template>

<script>
import { searchAddressByDistrict } from 'thai-address-database'

export default {
  name: 'app',
  data () {
    return {
      q: ''
    }
  },
  computed: {
    result () {
      return searchAddressByDistrict(this.q)
    }
  }
}
</script>

Database & Migration

ใน /database/raw_database มีไฟล์ฐานข้อมูลที่เป็น excel ชื่อว่า database.xlxs สามารถอัปเดทฐานข้อมูลได้ในนี้โดยเมื่ออัปเดตเรียบร้อยก็รันคำสั่ง

npm run migrate

ตัว script จะแปลงไฟล์ database.xlsx ไปเป็น /database/db.json ให้ (ยังไม่ support geodb)

ปล.ข้อควรระวังคือ file excel จะต้องเป็น xlxs เสมอ

Todos

  • Add Standard style(ESLint)
  • Unit test
  • คิดชื่อ npm package
  • Deploy to npmjs.com
  • Add code coverage report
  • Refactoring
  • เพิ่มวิธีการใช้งานใน README.md
  • โหมดค้นหา

Publish to npmjs

npm run deploy

About

ฐานข้อมูลที่อยู่ในไทย ไม่ต้องใช้ Server Side!

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%