0.1.0 • Published 3 years ago

morse.ahk v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

#morse

A simple Morse code library for AutoHotkey

Installation

In a terminal or command line:

npm install morse.ahk

In your code only export.ahk needs to be included:

#Include %A_ScriptDir%\node_modules
#Include morse.ahk\export.ahk

morse := new morse()
result := morse.decode("..-. --- --- ....... -... .- .-.")
; => "foo bar"

API

.encode(value)

Encodes and returns a given string or array

encoded := morse.encode("Hello, world.")
; => ".... . .-.. .-.. --- --..-- ....... .-- --- .-. .-.. -.. .-.-.-"

encoded := morse.encode(["hello", "world"])
; => [".... . .-.. .-.. ---", ".-- --- .-. .-.. -.."]

.decode(value)

Decodes and returns a string or array

morse.decode(".... . .-.. .-.. --- --..-- ....... .-- --- .-. .-.. -.. .-.-.-");
; => HELLO, WORLD.

morse.decode([".... . .-.. .-.. ---", ".-- --- .-. .-.. -.."]);
; => [ "HELLO", "WORLD" ]

attributes

morse.dict

An object containing morse: character translations