Phonetic Alphabet Converter parses a string into a list of NATO phonetic alphabet words.
Installation
You can download phonetic-alphabet-converter
from:
npm install phonetic-alphabet-converter
yarn add phonetic-alphabet-converter
<script src="https://unpkg.com/phonetic-alphabet-converter@latest/umd/phonetic-alphabet-converter.js"></script>
<script>
window.PhoneticAlphabetConverter.default(/* string */);
</script>
Motivation
I decided to publish another phonetic alphabet package because I couldn’t find one that builds to UMD.
My end goal was to build a static site so I wanted to load the library over a CDN instead of setting up a complicated build system.
Stack
The package is written in TypeScript. The setup did take some time initially; but afterwards, I found it simple to use and enjoyed the type checking.
The downside of TypeScript was that it didn’t support compiling to UMD with a global variable (see issue).
As a result, I had to add rollup to the build system. If you’re interested in learning how to configure a UMD build with rollup, check out this article.
Regarding the site, I used Material Components for the Web (MDC Web) as the design system. You can learn more by checking out its component styleguide.
Code
You can check out the code on GitHub. Pull requests are welcome.