# thai_address_th_en

> address thai language thai and english

Latest version **1.0.5-beta07** (published 2020-09-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install thai_address_th_en
pnpm add thai_address_th_en
yarn add thai_address_th_en
bun add thai_address_th_en
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5-beta07 |
| Published | 2020-09-11 |
| First published | 2020-09-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | darktew |
| Maintainers | akkapon |

## Links

- npm: https://www.npmjs.com/package/thai_address_th_en
- Repository: https://github.com/darktew/thai_address_th_en
- Homepage: https://github.com/darktew/thai_address_th_en/blob/master/README.md
- Issues: https://github.com/darktew/thai_address_th_en/issues
- npm.io page: https://npm.io/package/thai_address_th_en

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.20

## Recent versions

- 1.0.5-beta07 (latest) — 2020-09-11
- 1.0.5-beta06 — 2020-09-10
- 1.0.5-beta05 — 2020-09-09
- 1.0.5-beta04 — 2020-09-09
- 1.0.5-beta03 — 2020-09-09
- 1.0.5-beta02 — 2020-09-08
- 1.0.5-beta01 — 2020-09-08
- 1.0.5-beta — 2020-09-08
- 1.0.5 — 2020-09-04
- 1.0.4 — 2020-09-04
- 1.0.3 — 2020-09-04
- 1.0.2 — 2020-09-04
- 1.0.1 — 2020-09-04
- 1.0.0 — 2020-09-04

## README

# thai_address_th_en

THAI_ADDRESS_TH_EN

เป็น Libery ที่ทำขึ้นเพื่อให้สามารถดึงข้อมูล จังหวัด อำเภอและตำบล ของประเทศไทยมาใช้ได้ทั้งภาษาไทยและภาษาอังกฤษ

วิธีใช้

 - เรียก provinces
 
 ```
   const address = require('thai_address_th_en')
   
   address.provinces((res) => {
    console.log("province :", res)
   })
   
 ```

  - เรียก district
  ```
    const address = require('thai_address_th_en')
    
    address.district("กรุงเทพ", (res,err) => {
     if(err) {
      console.error(err)
     } else {
      console.log("district : ", res)
     }
    })
    
  ```
  
   - เรียก subDistrcit And Zipcode
   ```
    const address = require('thai_address_th_en')
    
    address.subDistrict("กรุงเทพ","มีนบุรี",(res,err) => {
     if(err) {
       console.error(err)
     } else {
      console.log("subDistrict :", res)
     }
    })
    
      Object return => [ { subDistrict : "example", zipcode: "example" } ]
    
   ```
   
  - เปลี่ยนภาษา
  ```
  address.locale("en")
  Default locale => th
  ```
  
  - convert TH to EN & EN to TH
  ```
  const address = require('thai_address_th_en')
  
  // type enum = ["p", "d", "sd"]
  // type p and d return string address value
  // type sd return value => { subDistrict : subDistrictValue, zipcode : zipcodeValue }
  
  address.convertTHToEN({ type: "p", data: { province: "ปทุมธานี" }  }, (res,err) => {
    if(err) {
     console.error(err)
    } else {
     console.log(res)
    }
  })
  ```

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