Socket
Socket
Sign inDemoInstall

thai-address-database

Package Overview
Dependencies
194
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    thai-address-database

[![Build Status](https://travis-ci.org/Sellsuki/thai-address-database.svg?branch=master)](https://travis-ci.org/Sellsuki/thai-address-database) [![Maintainability](https://api.codeclimate.com/v1/badges/f8046d4074243a3cc5e8/maintainability)](https://codecl


Version published
Weekly downloads
442
increased by11.06%
Maintainers
2
Install size
23.0 MB
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 14 Apr 2020

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc