Morsey (Morse Encoder/Decoder)
Morsey is JavaScript library to convert text to Morse code and vice versa.
Install
npm install morsey
Import
CommonJS
const Morsey = ;
ES6 import
;
CDN
You can use it directly in your browser using unpkg.com:
Usage
; // with optional 'options'const morse = wordspace: '|' ; morse;// => ··· ·- -- ·--· ·-·· · | - · -··- - morse;// => SAMPLE TEXT
API
morse.encode(text)
text
Type: string
Text to encode.
morse.decode(code)
code
Type: string
Morse code to decode.
options
Type: object
Default:
long: '-' short: '·' space: ' ' wordspace: '/'
Test
npm installnpm test
License
MIT © Zsolt Meszaros