0.1.1 • Published 11 years ago

morse-node v0.1.1

Weekly downloads
22
License
-
Repository
github
Last release
11 years ago

Morse Node

A very tiny, dependency-free Morse code encoder and decoder. Currently supports the ITU standard.

Install

  • Not yet available.
npm install morse-node

Getting Started

Setup API

 var morse = require('morse-node').create("ITU");

Encoding

var msg = morse.encode('The quick brown fox jumped over the lazy dog.');

Decoding

  • Letters are seperated by a single space.
  • Words are seperated by a forward slash " / ".
var msg = morse.decode("- .... ./--.- ..- .. -.-. -.-/-... .-. --- .-- -./..-. --- -..-/.--- ..- -- .--. . -../--- ...- . .-./- .... ./.-.. .- --.. -.--/-.. --- --. .-.-.-");

Example

example.js

var morse = require('./morse-node').create();

var msg = morse.encode('Pack my box with five dozen liquor jugs!');
console.log(msg);
console.log(morse.decode(msg));

Output

.--. .- -.-. -.- / -- -.-- / -... --- -..- / .-- .. - .... / ..-. .. ...- . / -.. --- --.. . -. / .-.. .. --.- ..- --- .-. / .--- ..- --. ... -.-.--
pack my box with five dozen liquor jugs!

Author

Calvin Nichols

0.1.1

11 years ago

0.1.0

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago