1.1.2 • Published 2 years ago

morse-module v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Morse Module

npm npm

This module will help you interpret Morse code into Latin text.

Installation

npm

$ npm i morse-module

Usage

const codeText = require('morse-module');
    
console.log(codeText.textToMorse('HELLO WORLD NODEJS'));
console.log(codeText.morseToText('-. --- -.. . .--- ...'));

Console

 .... . .-.. .-.. --- / .-- --- .-. .-.. -.. / -. --- -.. . .--- ...
 NODEJS

User guide

MethodDescriptionParameterReturn Value
textToMorse()convert morse code to latin textStringString
morseToText()convert latin text code to morse code, if the format of the code is invalid it will return Undefined.StringString undefined

Morse code format

  • 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) /.

List code suport

Latin

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--..

Numbers

0-----1.----2..---3...--4....-5.....
6-....7--...8---..9----.

Puntuation

..-.-.-,--..--?..--..'.----.!-.-.--/-..-.
(-.--.)-.--.-&.-...:---...;-.-.-.=-...-
+.-.-.--....-_..--.-".-..-.$...-..-@.--.-.
¿..-.-¡--...-