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

singlish-sinhala

v0.3.1

Published

High-performance Singlish → Sinhala transliteration engine compiled to WebAssembly. Full Sinhala script coverage, suggestion candidates, 100% client-side — no server, no tracking.

Readme

singlish-sinhala

High-performance Singlish → Sinhala transliteration engine compiled to WebAssembly.

  • 🚀 Runs 100% client-side — near-native speed, zero network calls, no server, no tracking
  • 🎯 ~100-word curated dictionary with exact spellings (ayubowanආයුබෝවන්)
  • 💡 Suggestion candidates for ambiguous words (t/d/n, th, sh …)
  • 🔁 Reverse transliteration: Sinhala → Singlish
  • 🧩 IME-ready syllable chunks for per-chunk backspace handling
  • 🦀 Built with Rust + wasm-bindgen; ships with TypeScript declarations

Install

npm install singlish-sinhala

Quick start — Browser (bundler / Vite / webpack)

import init, { transliterate } from 'singlish-sinhala';

await init(); // loads and instantiates the .wasm
transliterate('kohomada oya?'); // "කොහොමද ඔය?"

Quick start — CDN (no build step)

<script type="module">
  import init, { transliterate } from 'https://esm.sh/singlish-sinhala';
  await init();
  document.querySelector('#out').textContent = transliterate('ayubowan');
</script>

Quick start — Node.js (18+)

import init, { transliterate } from 'singlish-sinhala';
import { readFile } from 'node:fs/promises';

const wasm = await readFile(
  new URL('./node_modules/singlish-sinhala/singlish_core_bg.wasm', import.meta.url)
);
await init(wasm); // pass the .wasm bytes directly

API

| Function | Description | Example | | --- | --- | --- | | transliterate(text) | Full-string Singlish → Sinhala; preserves spaces & punctuation | "kohomada oya?""කොහොමද ඔය?" | | transliterate_word(word) | Single word, dictionary-aware | "ayubowan""ආයුබෝවන්" | | candidates(word) | Up to 5 suggestions for ambiguous words (primary first) | "kotha"["කොත","කොථ","කොට"] | | reverse_transliterate(text) | Sinhala → Singlish (best-effort, follows forward convention) | "සිංහල""singhala" | | split_chunks(word) | Sinhala syllable chunks; combining marks attach to their base (IME backspace) | "kohomada"["කො","හො","ම","ද"] | | is_sinhala_text(text) | true when ≥50% of non-space chars are Sinhala | "කොහොමද"true | | sinhala_char_count(text) | Count of Sinhala-range characters | "කොහොමද hello"6 | | transliterate_batch(words) | Bulk word conversion in one call | ["kohomada","bath"]["කොහොමද","බත්"] | | version() | Engine version string | "0.3.0" |

Typing conventions

  • Vowels — signs attach to the preceding consonant: ka, kaaකා, kaeකැ, keකෙ, kooකෝ Standalone: a, aa, ae, i, u, e, o
  • Consonant digraphsch, kh, gh, th, dh, sh, bh, ph, gn/ny
  • Nasalsng (singසිං), nkංක (lankaලංක)
  • Geminationkkaක්ක, ammaඅම්මා
  • Final consonant — gets virama: kක්
  • Case-insensitiveSri and sri behave identically

Dictionary

Common words resolve to their exact Sinhala spellings instead of phonetic guesses: ayubowanආයුබෝවන්, sri lankaශ්රී ලංකා, colomboකොළඹ, kandyමහනුවර, ammaඅම්මා, machangමචං, thambiliතැඹිලි, singhalaසිංහල

Demo

A full demo page (live typing, suggestions, direction toggle, copy) ships with the source repo. To run it:

cd singlish-core
wasm-pack build --target web
cd ..
python3 -m http.server 8000   # then open http://localhost:8000

License

MIT