npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jquery-khmer-address-formatter

v1.0.5

Published

jQuery plugin to auto-format Cambodian address strings with Khmer spacing and digit conversion.

Readme

jQuery Khmer Address Formatter

A lightweight, zero-dependency jQuery plugin designed to automatically format Cambodian address strings. It intelligently converts Western Arabic numerals (0-9) into Khmer digits (០-៩) and adds standard Khmer word spacing between administrative divisions (ភូមិ, ឃុំ, ស្រុក, ខេត្ត, etc.).

Key Features

  • 🇰🇭 Khmer Digit Translation: Automatically normalizes Western numerals (0-9) to official Khmer digits (០-៩).
  • 📍 Full Administrative Coverage: Supports all 25 Provinces/Autonomous Municipalities, Districts/Khan, Communes/Sangkat, Villages, and major landmark zones across Cambodia.
  • ⌨️ Form Input Auto-Formatting: Rebinds input events (blur, change, keypress) to clean up address entries dynamically.
  • 📄 Static Text View Support: Effortlessly formats non-input elements (<div>, <span>, <p>, <td>) rendered from server-side templates (CodeIgniter, Laravel, WordPress).
  • Performance Optimized: Uses sorted Regex boundary matching to prevent nested string collisions.

Installation

Via npm

npm install jquery-khmer-address-formatter

Via CDN (jsDelivr / unpkg)

<!-- jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.khmer-address-formatter.min.js"></script>

<!-- unpkg -->
<script src="https://unpkg.com/[email protected]/dist/jquery.khmer-address-formatter.min.js"></script>

Quick Start

<input type="text" id="address" placeholder="ភូមិ6សង្កាត់4អូរត្រេះព្រះសីហនុ">

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="yourpath/to/jquery.khmer-address-formatter.min.js"></script>
<script>
  $(document).ready(function() {
    $('#address').khmerAddressFormatter({
      spacing: 2,
      convertNumbers: true
    });
  });
</script>

Options

| Option | Type | Default | Description | | :--- | :--- | :--- | :--- | | event | string | 'blur' | Event that triggers formatting ('blur', 'change'). | | spacing | number | 2 | Number of spaces to insert between divisions. | | convertNumbers | boolean | true | Automatically converts Western digits (0-9) to Khmer digits (០-៩). | | onFormat | function | null | Callback triggered after formatting (function(formattedValue)). |

Utility Usage

You can also format address strings directly without binding to an input element:

const result = $.formatKhmerAddress('ភូមិ1ឃុំបិតត្រាំងស្រុកព្រៃនប់', 2, true);
// Output: "ភូមិ ១  ឃុំ  បិតត្រាំង  ស្រុក  ព្រៃនប់"

Developers

  • Chou Chamnan – Creator & Maintainer
  • GitHub: https://github.com/SmarterCoding
  • npm: https://www.npmjs.com/~chamnan_dev

Made with ❤️ in Cambodia 🇰🇭

License

MIT License