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

morse-translator-me

v1.0.0

Published

Zero-dependency Morse code encoder/decoder with the full ITU-R M.1677-1 table, opt-in Spanish extended letters and honest warnings. Powers https://morsetranslator.me.

Readme

morse-translator-me

Zero-dependency Morse code encoder/decoder for TypeScript and JavaScript. This is the engine that powers morsetranslator.me — a free Morse code translator, generator and audio decoder.

  • Full ITU-R M.1677-1 table — 26 letters, 10 digits, 18 punctuation marks, all collision-free.
  • Honest results — unsupported characters come back as warnings instead of being silently dropped.
  • Opt-in Spanish extended letters — Ñ Á É Ó Ú Ü from the widely cited historical table (off by default, so standard decoding never changes).
  • Reference data included — the code table and A–Z example words ship as exports, ready for teaching tools and cheat sheets.
  • No dependencies, tree-shakeable, ESM + CJS + TypeScript types, runs in Node and the browser.

Install

npm install morse-translator-me

Usage

import { encodeText, decodeMorse } from "morse-translator-me";

encodeText("HELLO WORLD");
// { output: ".... . .-.. .-.. --- / .-- --- .-. .-.. -..",
//   warnings: [], warningCount: 0 }

decodeMorse("... --- ...");
// { output: "SOS", warnings: [], warningCount: 0 }

Unsupported characters never break the conversion — you get the rest of the message plus a warning list:

encodeText("A#B~C");
// { output: ".- -... -.-.", warnings: ["#", "~"], warningCount: 2 }

Spanish extended letters

encodeText("Ñ", { spanish: true }).output;  // "--.--"
decodeMorse("..--", { spanish: true }).output;  // "Ü"

Notes: Ú and Ü intentionally share ..-- exactly as the historical tables did, so decoding that code yields Ü. Í has no agreed code (one common value collides with the digit 2), so it is transcribed as I and reported in transcribed instead of being invented.

Reference data

import { MORSE_ENTRIES, CHARACTER_BY_MORSE, ALPHABET_EXAMPLES } from "morse-translator-me";

MORSE_ENTRIES;        // [["A", ".-"], ["B", "-..."], ...] — 54 entries
CHARACTER_BY_MORSE;   // { ".-": "A", ... } — reverse lookup
ALPHABET_EXAMPLES;    // { A: { word: "apple", code: ".- .--. .--. .-.. ." }, ... }

API

encodeText(input: string, options?: { spanish?: boolean }): TranslationResult

Encodes plain text to Morse code. Letters are separated by spaces, words by /, lines are preserved.

decodeMorse(input: string, options?: { spanish?: boolean }): TranslationResult

Decodes Morse code to text. Words can be separated by / or by 3+ spaces. Invalid tokens decode as � and are listed in warnings.

TranslationResult

| Field | Type | Meaning | | --- | --- | --- | | output | string | Converted text. | | warnings | string[] | Up to 5 unique unsupported characters / invalid tokens. | | warningCount | number | Total number of problems. | | transcribed? | string[] | Spanish mode only: letters written as their base letter (Í → I). |

Try it in the browser

The full translator — with audio playback, adjustable WPM, light signals, an audio file decoder and printable charts — is at morsetranslator.me.

License

MIT