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

gotiengviet

v1.1.1

Published

Add Vietnamese typing to your web app. Supports Telex, VNI, VIQR input methods

Readme

gotiengviet

npm version license

English: Add Vietnamese typing to any web app — Telex, VNI, and VIQR. Zero runtime dependencies, TypeScript-ready.

Tiếng Việt: Thêm khả năng gõ tiếng Việt vào ứng dụng web — Telex, VNI, VIQR. Không phụ thuộc runtime, hỗ trợ TypeScript.


Installation / Cài đặt

npm install gotiengviet
yarn add gotiengviet
# pnpm add gotiengviet

Quick Start / Bắt đầu nhanh

English

import { VietnameseInput } from 'gotiengviet';

VietnameseInput.getInstance({
  inputMethod: 'telex', // 'telex' | 'vni' | 'viqr'
  enabled: true,
});

// Cleanup on SPA unmount or in tests
VietnameseInput.destroyInstance();

After initialization, all <input>, <textarea>, and contenteditable="true" elements on the page support Vietnamese typing automatically.

Example: type tieengs vieetjtiếng việt (Telex)

Tiếng Việt

import { VietnameseInput } from 'gotiengviet';

VietnameseInput.getInstance({
  inputMethod: 'telex', // 'telex' | 'vni' | 'viqr'
  enabled: true,
});

// Dọn dẹp khi unmount SPA hoặc trong test
VietnameseInput.destroyInstance();

Sau khi khởi tạo, mọi <input>, <textarea> và phần tử contenteditable="true" trên trang sẽ tự động hỗ trợ gõ tiếng Việt.

Ví dụ:tieengs vieetjtiếng việt (Telex)


Features / Tính năng

| English | Tiếng Việt | |---------|------------| | Telex, VNI, VIQR input methods | Ba bộ gõ Telex, VNI, VIQR | | Global DOM listener (singleton) | Lắng nghe DOM toàn cục (singleton) | | Smart skip for email, URL, code tokens | Bỏ qua email, URL, token giống mã nguồn | | contenteditable support | Hỗ trợ contenteditable | | Headless transform API | API transform không cần DOM | | Zero runtime dependencies | Không phụ thuộc runtime | | TypeScript definitions included | Kèm định nghĩa TypeScript |


Input Methods / Bộ gõ

| Method | Example input | Output | |--------|---------------|--------| | Telex | as | á | | Telex | uw | ư | | VNI | a1 | á | | VIQR | a' | á |

Switch at runtime:

const vi = VietnameseInput.getInstance();
vi.setInputMethod('vni');
vi.toggle(); // enable / disable

React Example / Ví dụ React

import { useEffect } from 'react';
import { VietnameseInput } from 'gotiengviet';

function App() {
  useEffect(() => {
    VietnameseInput.getInstance({ inputMethod: 'telex' });
    return () => VietnameseInput.destroyInstance();
  }, []);

  return <input placeholder="Type Vietnamese here / Gõ tiếng Việt tại đây" />;
}

Headless API / API không DOM

Use outside the browser (CLI, tests, server-side string processing):

import { processInputByMethod, applyToneToText } from 'gotiengviet';

applyToneToText('hoa', 1); // 'hoá'

API Summary / Tóm tắt API

| Export | Description / Mô tả | |--------|---------------------| | VietnameseInput | Singleton class for DOM integration | | VietnameseInput.getInstance(config?) | Get or create instance | | VietnameseInput.destroyInstance() | Remove listeners and reset | | enable() / disable() / toggle() | Control typing at runtime | | setInputMethod() / getInputMethod() | Switch Telex / VNI / VIQR | | processInputByMethod() | Pure string transform | | applyToneToText() | Apply tone mark to vowel | | InputConfig, InputMethod | TypeScript types |

Full reference: docs/api-reference.md


Requirements / Yêu cầu

  • Browser: ES2018+, setRangeText support
  • Node.js (development): >= 18.0.0

Documentation / Tài liệu

| | | |---|---| | Full docs (Vietnamese) | docs/README.md | | Getting started | docs/getting-started.md | | Input methods | docs/input-methods.md | | Changelog | docs/changelog.md |


License

MIT


Author / Tác giả

Trần Nhật Duy <[email protected]>