lipic-js transliteration building blocks (data-first)
npm install lipic-jsFast transliteration for web text inputs (input, textarea, contenteditable) with a JS/WASM hybrid runtime.




- Features
- Quick Start
- Supported Languages
- Usage Options
- Configuration
- Mobile Keyboard Notes
- Build Options
- Development
- Contributing
- License
- Easy integration: Works with input, textarea, and contenteditable elements
- 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
``bash`
npm install lipic-js
From GitHub (optional):
`bash`
npm install github:ranjeet-h/lipic-js
`ts
import { 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();
`
| 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) |bn
| Bengali | (Bengali), as (Assamese) |gu
| Gujarati | (Gujarati) |pa
| Gurmukhi | (Punjabi) |ta
| Tamil | (Tamil) |te
| Telugu | (Telugu) |kn
| Kannada | (Kannada) |ml
| Malayalam | (Malayalam) |or
| Odia | (Odia) |mni
| Meitei Mayek | (Manipuri) |sat
| Ol Chiki | (Santali) |ur
| Perso-Arabic | (Urdu), ks (Kashmiri) |si
| Sinhala | (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
`bash`
npm install lipic-js
`ts
import { enableTransliteration } from "lipic-js";
const session = await enableTransliteration({
language: "hi",
engineFactoryOptions: { isWasm: "auto" }
});
`
`html`
After npm run build:all, copy dist/ to your server:
`html`
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 available
- isWasm: 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:
`html`
type="text"
autocorrect="off"
autocapitalize="none"
autocomplete="off"
spellcheck="false"
inputmode="text"
/>
Guidelines:
- Prefer createInputInterceptor / enableTransliteration instead of custom keydown-only handlers.compositionstart
- Track composition via / compositionend if you build custom integration.insertReplacementText
- Expect mobile IME paths such as , insertFromComposition, and insertCompositionText.dist
- Hard-refresh after upgrades so clients load the latest bundle.
Reference implementation:
- playground/main.jsplayground/index.html
-
JavaScript-only build (default)
`bash`
npm run build:js-only
Build with WebAssembly
`bash`
npm run build:with-wasm
Artifacts:
- dist/dist/wasm/rust_core.js
- dist/wasm/rust_core_bg.wasm
-
Prerequisites
- Node.js 18+
- Rust (optional, only for WebAssembly builds)
Scripts
`bash
npm run build
npm run build:with-wasm
npm run test
npm run typecheck
npm run generate-map:all-languages
`
Language map generation
Mapping tables are derived from:
- @indic-transliteration/common_maps
`bash`
npm run generate-map:all-languages
Contributions 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.
`bash`
git clone https://github.com/ranjeet-h/lipic-js.git
cd lipic-js
npm install
npm run build
npm test
This project is licensed under the MIT License - see the LICENSE file for details.
- @indic-transliteration/common_maps` for comprehensive transliteration mappings
- The WebAssembly team for the amazing performance capabilities
- All contributors and users of this library
- 📖 Documentation
- 🎮 Live Playground
- 🐛 Report Issues
- 💬 Discussions