A simple Morse code library for browser
npm install morse-browser
First, include the morse.js in your html
<script src="morse.js"></script>
Then, use morse.encode to encode and morse.decode for decode
const encoded = morse.encode('Hello, world.');
// ...././.-../.-../---/--..--/......./.--/---/.-./.-../-../.-.-.-
morse.decode(encoded);
// HELLO, WORLD.
const encoded = morse.encode([ 'hello', 'world' ]);
// ["...././.-../.-../---", ".--/---/.-./.-../-.."]
morse.decode(encoded);
// [ 'HELLO', 'WORLD' ]
Encodes and returns a given string or array
Decodes and returns a string or array
MIT