1.0.1 • Published 6 years ago

morse-browser v1.0.1

Weekly downloads
9
License
-
Repository
github
Last release
6 years ago

morse-browser

A simple Morse code library for browser

Samuel F.B. Morse

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

1.0.1

6 years ago

1.0.0

6 years ago