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

@felix-tech/singlish-js

v0.1.3

Published

High performance Singlish to Sinhala Unicode transliteration engine.

Readme

@felix-tech/singlish-js

Zero-dependency TypeScript library that converts romanised Sinhala (Singlish) to Sinhala Unicode. Ships as dual CJS + ESM with full TypeScript declarations. < 1 KB gzipped.


Installation

npm install @felix-tech/singlish-js
# or
pnpm add @felix-tech/singlish-js
# or
yarn add @felix-tech/singlish-js

Quick start

import { transliterate } from "@felix-tech/singlish-js";

transliterate("mama"); // → "මම"
transliterate("mama gamata yanawa"); // → "මම ගමට යනව"
transliterate("keels paan"); // → "කීල්ස් පාන්"
transliterate("shrii"); // → "ශ්‍රී"
transliterate("sathYa"); // → "සත්‍ය"

API

transliterate(input: string): string

Converts a Singlish string to Sinhala Unicode. Non-Latin characters (digits, punctuation, spaces) pass through unchanged. The function never throws.

transliterate("mama gamata yanawa 123!"); // → "මම ගමට යනව 123!"
transliterate(""); // → ""

Transliteration reference

The golden rule — inherent vowel

Single a after a consonant is the inherent vowel — it produces a bare consonant with no modifier. To write the long ā (ා) you must type aa.

ma   → ම
maa  → මා
mama → මම

Vowels

Independent (word-initial / standalone)

| Input | Sinhala | | ------------------ | ------- | | a | අ | | aa | ආ | | A | ඇ | | Aa | ඈ | | ae | ඈ | | i | ඉ | | ii / ie / ee | ඊ | | u | උ | | uu / oo | ඌ | | e | එ | | ea / ei | ඒ | | o | ඔ | | oe | ඕ | | ai | ඓ | | au | ඖ |

Dependent modifiers (after a consonant)

Same input triggers the corresponding pilla instead of an independent vowel.

ka  → ක
kaa → කා
kA  → කැ
kAa → කෑ
ki  → කි
kii → කී
ku  → කු
ke  → කෙ
ko  → කො
koe → කෝ
kea → කේ

Base consonants

| Input | Sinhala | | Input | Sinhala | | | ----- | ------- | --- | --------- | ------- | --- | | k | ක | ka | n | න | na | | g | ග | ga | p | ප | pa | | j | ජ | ja | b | බ | ba | | t | ට | ṭa | m | ම | ma | | d | ඩ | ḍa | y | ය | ya | | sh | ශ | śa | r | ර | ra | | ch | ච | ca | l | ල | la | | th | ත | ta | v / w | ව | va | | dh | ද | da | s | ස | sa | | h | හ | ha | f | ෆ | fa | | kh | ඛ | kha | bh | භ | bha | | gh | ඝ | gha | ph | ඵ | pha | | q | ඣ | jha | | | |

Special / aspirated consonants (case-sensitive)

Uppercase letters invoke the aspirated or special form.

| Input | Sinhala | vs lowercase | | ----- | ------- | ------------ | | Sh | ෂ | sh → ශ | | Ch | ඡ | ch → ච | | Th | ථ | th → ත | | Dh | ධ | dh → ද | | K | ඛ | k → ක | | G | ඝ | g → ග | | T | ඨ | t → ට | | D | ඪ | d → ඩ | | P | ඵ | p → ප | | B | ඹ | b → බ | | N | ණ | n → න | | L | ළ | l → ල | | GN | ඥ | jña | | KN | ඤ | ña |

transliterate("Shri"); // → "ෂ්‍රි"
transliterate("shri"); // → "ශ්‍රි"
transliterate("aBa"); // → "අඹ"
transliterate("amba"); // → "අම්බ" (phonetic: a + m + ba)

Sanyaka (prenasalised) consonants

| Input | Sinhala | | ------ | ------- | | nng | ඟ | | nnd | ඬ | | nndh | ඳ |

Conjunct consonants

Conjuncts use two distinct triggers:

  • Rakaransaya — lowercase r after a consonant: krama, shrii
  • Yansayauppercase Y after a consonant: sathYa, aachaarYa

Lowercase y is always plain ය — no conjunct binding.

| Input | Sinhala | | ----------- | ------- | | krama | ක්‍රම | | shrii | ශ්‍රී | | sathYa | සත්‍ය | | aachaarYa | ආචාර්‍ය | | sathya | සත්ය |

Standalone glyphs via backslash sequences

| Input | Sinhala | | ----- | ------- | | \n | ං | | \h | ඃ | | \N | ඞ | | \R | ඍ |

transliterate("sitha\\n"); // → "සීතං"

Unicode output

All output codepoints are in the Sinhala Unicode block (U+0D80–U+0DFF), with the exception of U+200D (Zero Width Joiner) used to form conjunct ligatures.


TypeScript

The package ships .d.ts declarations. No @types/ package needed.

import type { transliterate } from "@felix-tech/singlish-js"; // fully typed

Use cases

  • Live input fields — wire transliterate to an oninput handler to render Sinhala as the user types romanised text.
  • IME / keyboard apps — use as the core conversion engine behind a mobile or browser-based Sinhala input method.
  • Content pipelines — bulk-convert legacy romanised Sinhala datasets to proper Unicode.
  • CLI tooling — generate Sinhala strings in i18n files or database seeds without a system IME.
  • Search preprocessing — expand romanised queries to Unicode before querying Sinhala document indices.

License

MIT