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

lipilekhika

v1.0.4

Published

A transliteration library for Indian Brahmic scripts

Readme

Lipi Lekhika — JavaScript/TypeScript

A powerful, typesafe transliteration library for Indian Brahmic scripts with real-time typing support

npm version npm downloads Tests License: MIT

📖 Documentation • 🌐 Website • 📝 Changelog

✨ Features

  • 🔄 Bidirectional Transliteration — Convert between 15+ Indian Brahmic scripts
  • 🛡️ Full TypeScript Support — Type-safe script/language names and options
  • 📦 Multiple Module Formats — Tree-shakable ESM, CommonJS, and UMD builds
  • Real-time Typing — Low-latency typing engine for browser environments
  • 🚀 WASM Support - Use Blazing fast Rust 🦀 in JS environments
  • 🎯 Highly Customizable — Fine-tune transliteration with custom options
  • 🌍 Universal Runtime — Works in Node.js, browsers, Deno, Bun, and more
  • 🪶 Lightweight — Only 7 KB gzipped

📥 Installation

npm install lipilekhika
pnpm add lipilekhika
bun add lipilekhika
yarn add lipilekhika

🚀 Quick Start

Basic Transliteration

import { transliterate } from 'lipilekhika';

// Transliterate from Normal script to Devanagari
const result = await transliterate('na jAyatE mriyatE vA', 'Normal', 'Devanagari');
console.log(result); // न जायते म्रियते वा

With Custom Options

import { transliterate } from 'lipilekhika';

const result = await transliterate(
  'గంగా',
  'Devanagari',
  'Gujarati',
  { 'brahmic_to_brahmic:replace_pancham_varga_varna_with_anusvAra': true }
);
console.log(result); // ગંગા (instead of ગઙ્ગા)

📖 See all Custom Transliteration Options

📚 Core API

Functions

Parameters:

  • text: string — Text to transliterate
  • from: ScriptLangType — Source script/language
  • to: ScriptLangType — Target script/language
  • options?: TransliterationOptions — Custom transliteration options

Returns: Promise<string>

Parameters:

  • name: ScriptLangType — Script/language name to preload

Returns: Promise<ScriptData>

Note: Useful in browsers to avoid initial loading delay.

Parameters:

  • from: ScriptLangType — Source script/language
  • to: ScriptLangType — Target script/language

Returns: Promise<string[]>

Read more about WASM Module

Parameters:

  • text: string — Text to transliterate
  • from: ScriptLangType — Source script/language
  • to: ScriptLangType — Target script/language
  • options?: TransliterationOptions — Custom transliteration options

Returns: Promise<string>

Note: Uses the fast Rust-based WASM implementation for improved performance. Works in all JavaScript environments (Node.js, browsers, Deno, Bun).

Returns: Promise<void>

Note: Preloads the WASM module to avoid initial loading delay when using transliterate_wasm.

Constants & Types

import { SCRIPT_LIST, LANG_LIST, ALL_LANG_SCRIPT_LIST } from 'lipilekhika';
import type { ScriptLangType, TransliterationOptions } from 'lipilekhika';

| Export | Description | |--------|-------------| | SCRIPT_LIST | Array of all supported script names | | LANG_LIST | Array of all supported language names mapped to scripts | | ALL_LANG_SCRIPT_LIST | Combined list of all scripts and languages | | ScriptLangType | Type for script/language identifiers (includes aliases) | | TransliterationOptions | Type for custom transliteration options | | ScriptListType | Type for the script list | | LangListType | Type for the language list |

⌨️ Real-time Typing

Enable real-time transliteration as users type in <textarea> and <input> elements.

import {
  createTypingContext,
  handleTypingBeforeInputEvent,
  clearTypingContextOnKeyDown
} from 'lipilekhika/typing';

📖 Browser Typing Tool GuideAPI Reference

Quick Example

import { createTypingContext, handleTypingBeforeInputEvent, clearTypingContextOnKeyDown } from 'lipilekhika/typing';

const ctx = createTypingContext('Telugu');

<textarea
  onBeforeInput={(e) => handleTypingBeforeInputEvent(ctx, e, setText)}
  onBlur={() => ctx.clearContext()}
  onKeyDown={(e) => clearTypingContextOnKeyDown(e, ctx)}
/>

API

Parameters:

  • script: ScriptLangType — Target script/language for typing
  • options?: TypingOptions — Custom typing options
    • autoContextClearTimeMs?: number (default: 4500)
    • useNativeNumerals?: boolean (default: true)
    • includeInherentVowel?: boolean (default: false)

Returns: TypingContext with:

  • ready: Promise<void> — Await before using (ensures script data loaded)
  • takeKeyInput(char: string) — Process character input and return diff
  • clearContext() — Clear internal state
  • updateUseNativeNumerals(value: boolean) — Update numeral preference
  • updateIncludeInherentVowel(value: boolean) — Update inherent vowel inclusion

Parameters:

  • ctx: TypingContext — Typing context
  • event: InputEvent — The beforeinput event
  • callback?: (newValue: string) => void — Called with updated value
  • options? — Additional options

Handles keyboard events (Arrow keys, Esc, etc.) to clear context appropriately.

Parameters:

  • event: KeyboardEvent — The keydown event
  • ctx: TypingContext — Typing context to clear

Additional Utilities

import { getScriptKramaData, getScriptTypingDataMap } from 'lipilekhika/typing';

// Get sequential character array (krama) for a script
const kramaData = await getScriptKramaData('Devanagari');
// Returns: [['अ', 'svara'], ['आ', 'svara'], ['क', 'vyanjana'], ...]

// Get detailed typing mappings for a script
const typingMap = await getScriptTypingDataMap('Telugu');
// Useful for building typing helper UIs

🌐 CDN Usage (No Build Step)

<script type="module">
  import { transliterate } from 'https://cdn.jsdelivr.net/npm/lipilekhika/dist/esm/index.mjs';
  
  const text = await transliterate('namaste', 'Normal', 'Devanagari');
  console.log(text); // नमस्ते
</script>
<script src="https://cdn.jsdelivr.net/npm/lipilekhika"></script>
<script>
  lipilekhika.transliterate('namaste', 'Normal', 'Devanagari')
    .then(text => console.log(text)); // नमस्ते
</script>

📖 Resources