1.0.1 • Published 6 years ago
morse-browser v1.0.1
morse-browser
A simple Morse code library for browser
install
npm install morse-browser
example usage
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' ]
methods
morse.encode(obj)
Encodes and returns a given string or array
morse.decode(obj)
Decodes and returns a string or array
license
MIT