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

glost-transcription

v0.4.1

Published

Transcription extension for GLOST - adds pronunciation data

Readme

glost-transcription

Language-agnostic transcription extension for GLOST.

Architecture

This package provides the core transcription logic. Language-specific implementations are provided by language packages:

  • glost-th/extensions - Thai RTGS, IPA, Paiboon
  • glost-ja/extensions - Japanese romaji, furigana
  • glost-zh/extensions - Chinese pinyin (coming soon)
  • etc.

Installation

# Core transcription extension (required)
npm install glost-transcription

# Language-specific provider (pick your language)
npm install glost-th      # Thai
npm install glost-ja      # Japanese

Usage

Basic Usage

import { createTranscriptionExtension } from "glost-transcription";
import { thaiTranscriptionProvider } from "glost-th/extensions";
import { processGLOSTWithExtensionsAsync } from "glost-extensions";

const extension = createTranscriptionExtension({
  targetLanguage: "th",
  provider: thaiTranscriptionProvider
});

const result = await processGLOSTWithExtensionsAsync(document, [extension]);

Japanese Example

import { createTranscriptionExtension } from "glost-transcription";
import { japaneseTranscriptionProvider } from "glost-ja/extensions";

const extension = createTranscriptionExtension({
  targetLanguage: "ja",
  provider: japaneseTranscriptionProvider
});

const result = await processGLOSTWithExtensionsAsync(document, [extension]);

Provider Interface

Language packages implement the TranscriptionProvider interface:

interface TranscriptionProvider {
  getTranscriptions(
    word: string,
    language: string
  ): Promise<Record<string, string> | undefined>;
}

Creating a Custom Provider

import type { TranscriptionProvider } from "glost-transcription";

const myProvider: TranscriptionProvider = {
  async getTranscriptions(word, language) {
    // Your transcription logic here
    // Could call an API, lookup in a dictionary, etc.
    
    return {
      ipa: "həˈloʊ",
      custom: "heh-LOH"
    };
  }
};

API

createTranscriptionExtension(options)

Creates a transcription extension.

Options:

  • targetLanguage (required): Language code (e.g., "th", "ja")
  • provider (required): Language-specific transcription provider

Returns: GLOSTExtension

Behavior

  • Only adds transcription if none exists (doesn't overwrite)
  • Removes trailing punctuation before lookup
  • Fails silently if provider can't transcribe a word
  • Supports multiple transcription schemes per word

Philosophy

Language Agnostic Core

The transcription extension is language agnostic:

  • ✅ Defines the provider interface
  • ✅ Implements the transformation logic
  • ✅ Handles document traversal
  • NO language-specific transcription data

Language-Specific Providers

Language packages provide language-specific implementations:

  • ✅ Transcription algorithms or APIs
  • ✅ Multiple transcription schemes
  • ✅ Language-specific rules
  • ✅ Dictionary lookups

Benefits:

  • Single extension works for all languages
  • Data stays in language packages (single source of truth)
  • Easy to add new languages
  • Clear separation of concerns

Implementation Guide

For Language Package Maintainers

To add transcription support for your language:

  1. Create extensions module in your language package:
glost-[lang]/
  src/
    extensions/
      transcription.ts    # Your provider implementation
      index.ts
  1. Implement the provider:
import type { TranscriptionProvider } from "glost-transcription";

export const myLanguageTranscriptionProvider: TranscriptionProvider = {
  async getTranscriptions(word, language) {
    // Your transcription logic
    return {
      ipa: "...",
      romanization: "..."
    };
  }
};
  1. Export from package.json:
{
  "exports": {
    "./extensions": {
      "types": "./dist/extensions/index.d.ts",
      "default": "./dist/extensions/index.js"
    }
  }
}
  1. Add dependency:
{
  "dependencies": {
    "glost-transcription": "workspace:*"
  }
}

Related Packages

  • glost - Core GLOST types
  • glost-extensions - Extension system
  • glost-th - Thai language support
  • glost-ja - Japanese language support

Documentation

License

MIT