morse-code-js

1.0.0 • Public • Published

Morse Code Js

NPM GitHub followers npm

morse-code-js is a mini javascript library that converts a given text to morse code or a given morse code back to text.

The key is based on the table below.

International Morse Code table

Alterations

For a bit of clarity, I

  1. I used * as dot and - as dash
  2. Made the dash one unit instead of three
  3. I used . to seperate the letters and | to seperate words.

Installation

npm install morse-code-js

Usage

const morseCode = require('morse-code-js');
 
morseCode.morse();
morseCode.string();
morseCode.morseSentence();
morseCode.stringSentence();

API

Method Params
morse() Takes a stringText and converts it to a morse code. Letters seperated by .
string() Takes an existing morseText and convert it to a readable string
morseSentence() Takes a stringSentence and converts it to a morse code. Words seperated by |
stringSentence() Takes a morseSentence and converts it to a string sentence

Author

Ephraim Atta-Duncan

License

MIT

Package Sidebar

Install

npm i morse-code-js

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

35.5 kB

Total Files

6

Last publish

Collaborators

  • dephraiim