morse-module
1.1.2 • Public • Published
This module will help you interpret Morse code into Latin text.
$ npm i morse-module
const codeText = require('morse-module');
console.log(codeText.textToMorse('HELLO WORLD NODEJS'));
console.log(codeText.morseToText('-. --- -.. . .--- ...'));
.... . .-.. .-.. --- / .-- --- .-. .-.. -.. / -. --- -.. . .--- ...
NODEJS
Method |
Description |
Parameter |
Return Value |
textToMorse() |
convert morse code to latin text |
String |
String |
morseToText() |
convert latin text code to morse code, if the format of the code is invalid it will return Undefined . |
String |
String undefined
|
- Morse code to be interpreted into Latin must have a space
between character, number or symbol.
- To represent a space it must be expressed as: space bar space
/
.
- Morse code must not contain a leading or trailing space.
- For Morse code, it is considered invalid if there are characters other than:
.
(space) /
.
A |
.- |
B |
-... |
C |
-.-. |
D |
-.. |
E |
. |
F |
..-. |
G |
--. |
H |
.... |
I |
.. |
J |
.--- |
K |
-.- |
L |
.-.. |
M |
-- |
N |
-. |
O |
--- |
P |
.--. |
Q |
--.- |
R |
.-. |
S |
... |
T |
- |
U |
..- |
V |
...- |
W |
.-- |
X |
-..- |
Y |
-.-- |
Z |
--.. |
|
|
|
|
|
|
|
|
0 |
----- |
1 |
.---- |
2 |
..--- |
3 |
...-- |
4 |
....- |
5 |
..... |
6 |
-.... |
7 |
--... |
8 |
---.. |
9 |
----. |
|
|
|
|
. |
.-.-.- |
, |
--..-- |
? |
..--.. |
' |
.----. |
! |
-.-.-- |
/ |
-..-. |
( |
-.--. |
) |
-.--.- |
& |
.-... |
: |
---... |
; |
-.-.-. |
= |
-...- |
+ |
.-.-. |
- |
-....- |
_ |
..--.- |
" |
.-..-. |
$ |
...-..- |
@ |
.--.-. |
¿ |
..-.- |
¡ |
--...- |
|
|
|
|
|
|
|
|
Package Sidebar
Install
Weekly Downloads