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

stenoky

v0.0.4

Published

A function that translates stenography notation into human-readable language.

Readme

stenoky.js

npm version

A small, TypeScript-first JavaScript library that translates steno notation into human-readable language (English, German, and others) using an AST-based parsing architecture from the very beginning.

Vision

Stenoky treats steno not as a flat string-replacement problem, but as a structured language.

All input is parsed into an Abstract Syntax Tree (AST) first, enabling:

  • Clean separation of parsing and translation
  • Multiple languages and steno theories
  • Future extensions (linting, transforms, reverse translation)
  • Predictable, testable behavior

Installation

npm install stenoky

Or with yarn:

yarn add stenoky

Or with pnpm:

pnpm add stenoky

Quick Start

import { stenoky } from 'stenoky';

const result = stenoky('STKPWHRAOEU', {
  language: 'en',
  theory: 'plover'
});
// "Hello"

Usage

Basic Example

import { stenoky } from 'stenoky';

// Single stroke
stenoky('STKPWHRAOEU');
// "Hello"

// Multiple strokes
stenoky('STKPWHRAOEU/HRO', {
  language: 'en',
  theory: 'plover'
});
// "Hello world"

Mixed Text Support

Stenoky automatically handles mixed text where regular words are preserved and only steno strokes are translated:

// Mixed text with steno strokes
stenoky('Hello STKPWHRAOEU world', {
  language: 'en',
  theory: 'plover'
});
// "Hello hello world"

// Regular text only (preserved as-is)
stenoky('The cat sat', {
  language: 'en',
  theory: 'plover'
});
// "The cat sat"

// Mixed text preserves original casing
stenoky('The STKPWHRAOEU Cat', {
  language: 'en',
  theory: 'plover'
});
// "The hello Cat"

This is particularly useful for OCR-read steno documents where steno notation is interspersed with regular text.

Options

interface StenokyOptions {
  /** Output language */
  language?: "en" | "de" | string;

  /** Steno theory (ruleset) */
  theory?: "plover" | "dks" | string;

  /** Custom dictionary overrides */
  dictionary?: StenoDictionary;

  /** Behavior for unknown strokes */
  unknownStroke?: "keep" | "remove" | "mark";

  /** Output formatting options */
  format?: {
    capitalization?: "none" | "sentence" | "title";
    spacing?: boolean;
  };
}

Custom Dictionary

import { stenoky } from 'stenoky';

const result = stenoky('STKPWHRAOEU', {
  dictionary: {
    'STKPWHRAOEU': 'greetings'
  }
});
// "Greetings"

Unknown Stroke Handling

// Keep unknown strokes
stenoky('UNKNOWN', { unknownStroke: 'keep' });
// "[UNKNOWN]"

// Remove unknown strokes
stenoky('UNKNOWN', { unknownStroke: 'remove' });
// ""

// Mark unknown strokes with replacement character
stenoky('UNKNOWN', { unknownStroke: 'mark' });
// ""

Formatting Options

// Sentence capitalization (default)
stenoky('STKPWHRAOEU/HRO', {
  format: { capitalization: 'sentence' }
});
// "Hello world"

// Title capitalization
stenoky('STKPWHRAOEU/HRO', {
  format: { capitalization: 'title' }
});
// "Hello World"

// No capitalization
stenoky('STKPWHRAOEU/HRO', {
  format: { capitalization: 'none' }
});
// "hello world"

// No spacing
stenoky('STKPWHRAOEU/HRO', {
  format: { spacing: false }
});
// "Helloworld"

Architecture

Stenoky uses an AST-based parsing architecture:

Steno String
   ↓
Tokenizer
   ↓
Parser
   ↓
AST
   ↓
Theory Engine
   ↓
Dictionary Lookup
   ↓
Translator
   ↓
Formatter
   ↓
Human-readable Output

1. Tokenizer

Converts raw input into tokens, handling separators (/, space, newline) and normalizing input.

2. Parser (AST Builder)

Converts tokens into an Abstract Syntax Tree. The AST is language-, theory-, and dictionary-agnostic.

3. Theory Engine

Interprets AST nodes according to a steno theory (e.g., Plover for English, DKS for German). Validates and normalizes strokes.

4. Dictionary Layer

Maps normalized strokes to words or syllables. Supports built-in and user-provided dictionaries with override support.

5. Translator

Walks the AST, translates each stroke node into semantic output tokens, and handles unknown strokes based on configuration.

6. Formatter

Converts semantic tokens into a string, applying spacing, capitalization, and cleanup rules.

Supported Theories

  • Plover - English steno theory (default)
  • DKS - German steno theory (stub for future implementation)

TypeScript Support

Stenoky is written in TypeScript and provides full type definitions:

import { stenoky, type StenokyOptions, type StenoDictionary } from 'stenoky';

const options: StenokyOptions = {
  language: 'en',
  theory: 'plover',
  format: {
    capitalization: 'sentence'
  }
};

API Reference

stenoky(steno: string, options?: StenokyOptions): string

Translates steno notation to human-readable text.

Parameters:

  • steno - Steno notation string to translate
  • options - Optional translation options

Returns: Human-readable text output

Example:

const result = stenoky('STKPWHRAOEU', { language: 'en', theory: 'plover' });

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Roadmap

  • [ ] Expose AST API (stenoky.parse)
  • [ ] Streaming / incremental parsing
  • [ ] CLI tool
  • [ ] Dictionary tooling
  • [ ] Reverse translation (text → steno)
  • [ ] Editor / IDE integrations