Morse Code Js
morse-code-js is a mini javascript library that converts a given text to morse code or a given morse code back to text.
The key is based on the table below.

Alterations
For a bit of clarity, I
- I used
*
as dot and-
as dash - Made the dash one unit instead of three
- I used
.
to seperate the letters and|
to seperate words.
Installation
npm install morse-code-js
Usage
const morseCode = ; morseCode;morseCode;morseCode;morseCode;
API
Method | Params |
---|---|
morse() |
Takes a stringText and converts it to a morse code. Letters seperated by . |
string() |
Takes an existing morseText and convert it to a readable string |
morseSentence() |
Takes a stringSentence and converts it to a morse code. Words seperated by | |
stringSentence() |
Takes a morseSentence and converts it to a string sentence |