The `thai-address-database` package offers a client-side solution for managing and searching Thai address data within JavaScript applications. Currently at version 0.0.30, it provides functions like `searchAddressByDistrict` to query a local `db.json` file, eliminating the need for a server-side component for address lookups. The library is based on the database and `preprocess()` function from `jquery.Thailand.js` version 1.5.1. While it allows for database updates via an `npm run migrate` script, which converts a `database.xlsx` file into `db.json`, it is still in early development, with noted limitations such as exclusive support for `db.json` and no current support for `db.zip` or geodatabases. Its primary differentiator is enabling offline or client-only address search capabilities for Thai addresses.
npm install thai-address-databaseVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and use the `searchAddressByDistrict` function to query Thai address data, logging results to the console.
Ensure your database is in `db.json` format. The package includes an `npm run migrate` script to convert `database.xlsx` to `db.json`.
Run `npm run migrate` in your project's root directory after updating `database.xlsx`. Ensure the Excel file is always `.xlsx` format.
Refer to the `thai-address-database` documentation for specific functionality. If you require features or data from newer `jquery.Thailand.js` versions, you may need to contribute or seek alternatives.
Run `npm install thai-address-database` or `yarn add thai-address-database` in your project directory.
Use a named import: `import { searchAddressByDistrict } from 'thai-address-database';`Ensure the package is fully installed and the database file is present. If you are developing or have manually altered the database, run `npm run migrate` to generate/restore `db.json` from `database.xlsx`.
No dependency data recorded yet.