morse-browser

1.0.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i morse-browser

      Weekly Downloads

      0

      Version

      1.0.1

      License

      none

      Unpacked Size

      35.8 kB

      Total Files

      6

      Last publish

      Collaborators

      • twesix