1.0.0 • Published 4 years ago
morse-code-js v1.0.0
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 = require('morse-code-js');
morseCode.morse();
morseCode.string();
morseCode.morseSentence();
morseCode.stringSentence();
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 |
Author
License
1.0.0
4 years ago