Fast transliteration for web text inputs (input, textarea, contenteditable) with a JS/WASM hybrid runtime.
Playground โข Issues โข Discussions
- Features
- Quick Start
- Supported Languages
- Usage Options
- Configuration
- Mobile Keyboard Notes
- Build Options
- Development
- Contributing
- License
- Easy integration: Works with
input,textarea, andcontenteditableelements - High performance: Hybrid JavaScript/WebAssembly runtime
- Multi-language support: 27 Indian and South Asian languages across major scripts
- Flexible installation: npm, CDN, or self-hosted
- Type-safe: First-class TypeScript support
npm install lipic-jsFrom GitHub (optional):
npm install github:ranjeet-h/lipic-jsimport { enableTransliteration } from "lipic-js";
// Enable transliteration for Hindi
const session = await enableTransliteration({
language: "hi",
selector: "input[type='text'], textarea, [contenteditable='true']"
});
// Later, when you want to disable
session.detach();Total supported languages: 27
| Script | Languages |
|---|---|
| Devanagari | hi (Hindi), mr (Marathi), ne (Nepali), sa (Sanskrit), kok (Konkani), mai (Maithili), doi (Dogri), brx (Bodo), sd (Sindhi), hne (Chhattisgarhi), bho (Bhojpuri), raj (Rajasthani), awa (Awadhi) |
| Bengali | bn (Bengali), as (Assamese) |
| Gujarati | gu (Gujarati) |
| Gurmukhi | pa (Punjabi) |
| Tamil | ta (Tamil) |
| Telugu | te (Telugu) |
| Kannada | kn (Kannada) |
| Malayalam | ml (Malayalam) |
| Odia | or (Odia) |
| Meitei Mayek | mni (Manipuri) |
| Ol Chiki | sat (Santali) |
| Perso-Arabic | ur (Urdu), ks (Kashmiri) |
| Sinhala | si (Sinhala) |
Currently Available (27): hi, mr, ne, sa, bn, as, gu, pa, ta, te, kn, ml, or, kok, mai, doi, brx, sd, hne, bho, raj, awa, mni, sat, ur, ks, si
npm install lipic-jsimport { enableTransliteration } from "lipic-js";
const session = await enableTransliteration({
language: "hi",
engineFactoryOptions: { isWasm: "auto" }
});<script src="https://cdn.jsdelivr.net/npm/lipic-js@1.1.1/dist/lipic-js.iife.min.js"></script>
<script>
// API is exposed as window.LipicJS
(async () => {
const session = await window.LipicJS.enableTransliteration({
language: "hi",
engineFactoryOptions: { isWasm: "auto" }
});
window._lipicSession = session;
})();
</script>After npm run build:all, copy dist/ to your server:
<script type="module">
import { enableTransliteration } from "/assets/lipic-js/index.js";
const session = await enableTransliteration({
language: "hi",
engineFactoryOptions: { isWasm: "auto" }
});
</script>Required files for direct hosting:
/assets/lipic-js/index.js(or cjs/iife variant)/assets/lipic-js/wasm/rust_core.js/assets/lipic-js/wasm/rust_core_bg.wasm
WebAssembly control
createHybridTransliterationEngine and enableTransliteration support:
isWasm: "auto"(default): Use JS for keystrokes and WASM for batch processing when availableisWasm: true: Prefer WASM strongly (falls back to JS if WASM files are missing)isWasm: false: Force JS
If dist/wasm files are not present, the library continues with the JavaScript engine without breaking.
Android/iOS keyboards (for example Samsung Keyboard, SwiftKey, Gboard) may emit composition/replacement input events instead of plain key events. lipic-js now handles these core event paths in the interceptor, but host setup still matters.
Recommended host setup for input, textarea, and contenteditable:
<input
type="text"
autocorrect="off"
autocapitalize="none"
autocomplete="off"
spellcheck="false"
inputmode="text"
/>Guidelines:
- Prefer
createInputInterceptor/enableTransliterationinstead of custom keydown-only handlers. - Track composition via
compositionstart/compositionendif you build custom integration. - Expect mobile IME paths such as
insertReplacementText,insertFromComposition, andinsertCompositionText. - Hard-refresh after upgrades so clients load the latest
distbundle.
Reference implementation:
playground/main.jsplayground/index.html
JavaScript-only build (default)
npm run build:js-onlyBuild with WebAssembly
npm run build:with-wasmArtifacts:
dist/dist/wasm/rust_core.jsdist/wasm/rust_core_bg.wasm
Prerequisites
- Node.js 18+
- Rust (optional, only for WebAssembly builds)
Scripts
npm run build
npm run build:with-wasm
npm run test
npm run typecheck
npm run generate-map:all-languagesLanguage map generation
Mapping tables are derived from:
npm run generate-map:all-languagesContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git clone https://github.com/ranjeet-h/lipic-js.git
cd lipic-js
npm install
npm run build
npm testThis project is licensed under the MIT License - see the LICENSE file for details.
@indic-transliteration/common_mapsfor comprehensive transliteration mappings- The WebAssembly team for the amazing performance capabilities
- All contributors and users of this library
- ๐ Documentation
- ๐ฎ Live Playground
- ๐ Report Issues
- ๐ฌ Discussions