New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

thai-address-database

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thai-address-database

Thai Address Database for managing addresses in applications.

  • 0.0.30
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
364
decreased by-12.92%
Maintainers
0
Weekly downloads
 
Created
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

Package last updated on 30 Oct 2024

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc