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

@piraisoodan/tanglish-tiptap

v0.1.2

Published

TipTap extension for real-time transliteration using @piraisoodan/tanglish

Readme

@piraisoodan/tanglish-tiptap

License NPM CI

TipTap extension for real-time transliteration using @piraisoodan/tanglish.

License: MIT

Features

  • Real-time Transliteration: Automatically converts romanized text on Space/Enter
  • Suggestion Popup: Shows matching Tamil words as you type
  • Toggle Support: Enable/disable transliteration on the fly
  • Keyboard Shortcuts: Ctrl+Shift+T to toggle
  • Selection Transliteration: Convert selected text to Tamil
  • Framework Agnostic: Works with any UI framework (React, Vue, Svelte, etc.)

Installation

# npm
npm install @piraisoodan/tanglish @piraisoodan/tanglish-tiptap

# bun
bun add @piraisoodan/tanglish @piraisoodan/tanglish-tiptap

# yarn
yarn add @piraisoodan/tanglish @piraisoodan/tanglish-tiptap

Quick Start

import { Editor } from "@tiptap/core";
import StarterKit from "@tiptap/starter-kit";
import { Transliteration } from "@piraisoodan/tanglish-tiptap";

const editor = new Editor({
  element: document.querySelector("#editor"),
  extensions: [
    StarterKit,
    Transliteration.configure({
      enabled: true,
    }),
  ],
});

Usage with Suggestions Popup

import {
  type TanglishSuggestion,
  Transliteration,
} from "@piraisoodan/tanglish-tiptap";

// Track suggestions state in your UI framework
let suggestions: TanglishSuggestion[] = [];
let popupPosition: { top: number; left: number } | null = null;

const editor = new Editor({
  extensions: [
    StarterKit,
    Transliteration.configure({
      enabled: true,
      minCharsForSuggestion: 2,
      maxSuggestions: 8,
      onSuggestionsUpdate: (newSuggestions, position) => {
        suggestions = newSuggestions;
        popupPosition = position;
        // Update your popup UI here
      },
    }),
  ],
});

Svelte Example

<script lang="ts">
  import { onMount, onDestroy } from 'svelte';
  import { Editor } from '@tiptap/core';
  import StarterKit from '@tiptap/starter-kit';
  import {
    Transliteration,
    type TanglishSuggestion
  } from '@piraisoodan/tanglish-tiptap';

  let element: HTMLElement;
  let editor: Editor;
  let suggestions: TanglishSuggestion[] = [];
  let popupPosition: { top: number; left: number } | null = null;

  onMount(() => {
    editor = new Editor({
      element,
      extensions: [
        StarterKit,
        Transliteration.configure({
          enabled: true,
          onSuggestionsUpdate: (s, p) => {
            suggestions = s;
            popupPosition = p;
          },
        }),
      ],
    });
  });

  onDestroy(() => {
    if (editor) {
      editor.destroy();
    }
  });
</script>

<div bind:this={element}></div>

{#if suggestions.length > 0 && popupPosition}
  <div
    style="position: fixed; top: {popupPosition.top}px; left: {popupPosition.left}px;"
  >
    {#each suggestions as s}
      <div>{s.tanglish} → {s.tamil}</div>
    {/each}
  </div>
{/if}

React Example

import { EditorContent, useEditor } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import {
  type TanglishSuggestion,
  Transliteration,
} from "@piraisoodan/tanglish-tiptap";
import { useState } from "react";

function TamilEditor() {
  const [suggestions, setSuggestions] = useState<TanglishSuggestion[]>([]);
  const [position, setPosition] = useState<
    { top: number; left: number } | null
  >(null);

  const editor = useEditor({
    extensions: [
      StarterKit,
      Transliteration.configure({
        enabled: true,
        onSuggestionsUpdate: (s, p) => {
          setSuggestions(s);
          setPosition(p);
        },
      }),
    ],
  });

  return (
    <div>
      <EditorContent editor={editor} />
      {suggestions.length > 0 && position && (
        <div
          style={{ position: "fixed", top: position.top, left: position.left }}
        >
          {suggestions.map((s, i) => (
            <div
              key={i}
              onClick={() => selectSuggestion(s)}
            >
              {s.tanglish} → {s.tamil}
            </div>
          ))}
        </div>
      )}
    </div>
  );
}

Commands

// Toggle transliteration on/off
editor.commands.toggleTransliteration();

// Enable/disable directly
editor.commands.setTransliteration(true);
editor.commands.setTransliteration(false);

// Transliterate selected text
editor.commands.transliterateSelection();

Keyboard Shortcuts

| Shortcut | Action | | ------------------------------ | ---------------------- | | Ctrl+Shift+T / Cmd+Shift+T | Toggle transliteration |

Configuration Options

| Option | Type | Default | Description | | ----------------------- | ---------------- | ---------------- | --------------------------------------- | | enabled | boolean | false | Initial enabled state | | language | LanguageConfig | Tamil | Language configuration | | triggerChars | string[] | [' ', 'Enter'] | Characters that trigger transliteration | | onSuggestionsUpdate | function | undefined | Callback for suggestion updates | | minCharsForSuggestion | number | 2 | Min chars before showing suggestions | | maxSuggestions | number | 8 | Max suggestions to show |

Standalone Helper

Use transliteration outside of TipTap:

import { createSuggestionHandler } from "@piraisoodan/tanglish-tiptap";

const handler = createSuggestionHandler();

// Get suggestions
const suggestions = handler.getSuggestions("van", 5);
// [{ tanglish: 'vanakkam', tamil: 'வணக்கம்' }, ...]

// Transliterate
const tamil = handler.transliterate("nandri");
// நன்றி

// Check for Tamil text
handler.containsTargetScript("வணக்கம்"); // true

Peer Dependencies

This package requires:

  • @tiptap/core ^2.0.0 || ^3.0.0
  • @tiptap/pm ^2.0.0 || ^3.0.0
  • @piraisoodan/tanglish >=0.1.0

Development

# Clone
git clone https://github.com/piraisoodan-hq/tanglish-tiptap.git
cd tanglish-tiptap

# Install dependencies
bun install

# Build
bun run build

License

MIT © Piraisoodan Team

Related Projects