# thai-address-database

> Thai Address Database for managing addresses in applications.

Latest version **0.0.33** (published 2026-09-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install thai-address-database
pnpm add thai-address-database
yarn add thai-address-database
bun add thai-address-database
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.33 |
| Published | 2026-09-03 |
| First published | 2017-07-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 14 |
| Unpacked size | 2.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 75 |
| Maintainers | n9ti, sellsuki, sellsuki-devops, sellsuki-group, boom-sellsuki, tewan-sellsuki |

## Links

- npm: https://www.npmjs.com/package/thai-address-database
- Repository: https://github.com/Sellsuki/thai-address-database
- Homepage: https://github.com/Sellsuki/thai-address-database#readme
- Issues: https://github.com/Sellsuki/thai-address-database/issues
- npm.io page: https://npm.io/package/thai-address-database

## Dependencies (14)

- [mocha](https://npm.io/package/mocha.md) ^10.7.3
- [mkdirp](https://npm.io/package/mkdirp.md) ^3.0.1
- [rimraf](https://npm.io/package/rimraf.md) ^6.0.1
- [core-js](https://npm.io/package/core-js.md) ^3.38.1
- [wordcut](https://npm.io/package/wordcut.md) ^0.8.2
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.25.9
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.26.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.26.0
- [@babel/register](https://npm.io/package/@babel/register.md) ^7.25.9
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.26.0
- [regenerator-runtime](https://npm.io/package/regenerator-runtime.md) ^0.14.1
- [@babel/eslint-parser](https://npm.io/package/@babel/eslint-parser.md) ^7.25.9
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^3.8.0
- [eslint-plugin-standard](https://npm.io/package/eslint-plugin-standard.md) ^3.1.0

## Recent versions

- 0.0.33 (latest) — 2026-09-03
- 0.0.32 — 2026-08-27
- 0.0.31 — 2026-07-09
- 0.0.30 — 2024-10-30
- 0.0.29 — 2020-04-14
- 0.0.28 — 2020-03-26
- 0.0.27 — 2020-03-09
- 0.0.25 — 2018-01-19
- 0.0.23 — 2018-01-19
- 0.0.22 — 2018-01-04
- 0.0.20 — 2017-12-28
- 0.0.18 — 2017-12-27
- 0.0.16 — 2017-12-12
- 0.0.14 — 2017-10-16
- 0.0.10 — 2017-10-12
- … 6 more at https://npm.io/package/thai-address-database/versions

## README

[![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://codeclimate.com/github/Sellsuki/thai-address-database/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/f8046d4074243a3cc5e8/test_coverage)](https://codeclimate.com/github/Sellsuki/thai-address-database/test_coverage)

# thai-address-database

ฐานข้อมูลที่อยู่ในไทย ไม่ต้องใช้ Server Side!

## Original Version

**database** และ function **preprocess()** จาก ตั้นฉบับ version **1.5.1**

[[Commit: 4e5f496](https://github.com/earthchie/jquery.Thailand.js/commit/4e5f496f5db064bf56c163514167796816d9e357)]

## ข้อจำกัด

* ตอนนี้รองรับแค่ db.json
* ยังไม่รองรับ db.zip
* ยังไม่รองรับ geodb

## Example

```bash
yarn add thai-address-database
```

```vue
<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 สามารถอัปเดทฐานข้อมูลได้ในนี้โดยเมื่ออัปเดตเรียบร้อยก็รันคำสั่ง

```bash
npm run migrate
```

ตัว script จะแปลงไฟล์ database.xlsx ไปเป็น /database/db.json ให้ (ยังไม่ support geodb)

ปล.ข้อควรระวังคือ file excel จะต้องเป็น xlxs เสมอ

## Todos

* [x] Add Standard style(ESLint)
* [x] Unit test
* [x] คิดชื่อ npm package
* [x] Deploy to npmjs.com
* [ ] Add code coverage report
* [ ] Refactoring
* [ ] เพิ่มวิธีการใช้งานใน README.md
* [ ] โหมดค้นหา

## Publish to npmjs

```bash
npm run deploy
```

---
_Source: https://npm.io/package/thai-address-database · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
