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

thai-english-text-toggler

v1.0.2

Published

Library สำหรับสลับตัวอักษรภาษาไทยและอังกฤษสำหรับแก้ไขปัญหาลืมเปลี่ยนภาษาตอนพิมพ์

Downloads

4

Readme

Thai English Text Toggler

A JavaScript library for toggling between Thai and English text - perfect for fixing "forgot to change language" typing mistakes.

Installation

npm install thai-english-text-toggler

Usage

Basic Usage

const { toggleThaiEnglishStringInput } = require('thai-english-text-toggler');

// Example 1: English to Thai
const englishText = 'l;ylfu';
console.log(toggleThaiEnglishStringInput(englishText)); // สวัสดี

// Example 2: Thai to English  
const thaiText = 'าพีิ';
console.log(toggleThaiEnglishStringInput(thaiText)); // krub

// Example 3: Mixed text with context-aware conversion
const mixedText = ']n,gx]ujpo4kKk น้ ืน';
console.log(toggleThaiEnglishStringInput(mixedText)); // ลืมเปลี่ยนภาษา oh no

API Reference

toggleThaiEnglishStringInput(input)

Converts text between Thai and English keyboard layouts with smart context detection.

Parameters:

  • input (string): The text to toggle

Returns:

  • (string): The converted text

Example:

toggleThaiEnglishStringInput('l;ylfu'); // Returns: สวัสดี
toggleThaiEnglishStringInput('สวัสดี'); // Returns: l;ylfu

Supported Characters

  • All Thai consonants (ก-ฮ)
  • Thai vowels and tone markers
  • Thai numbers (๐-๙)
  • English letters (a-z, A-Z)
  • Numbers (0-9)
  • Special characters and punctuation
  • Context-aware handling of ambiguous mappings

Development

Running Tests

npm test

Project Structure

thai-english-text-toggler/
├── index.js                           # Main entry point
├── utils/
│   ├── text-toggler.js               # Core conversion logic
├── data/
│   ├── thai-english-keyboard-text-dictionary.json  # Character mappings
│   └── duplicate-mappings.json       # Context-aware duplicate mappings
└── test/
    └── utils/
        ├── text-toggler.test.js      # Core functionality tests

Use Cases

  • Fix "forgot to change language" typing mistakes
  • Text processing applications
  • Keyboard layout conversion tools
  • Thai-English bilingual applications
  • Input validation and text normalization

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add some amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

Repository

GitHub: https://github.com/Fill-IT/thai-english-text-toggler

License

MIT

Keywords

thai, english, ลืมเปลี่ยนภาษา, forget, to, change, language, text, toggler, keyboard, layout, conversion