Xmorseis a pure javascript(~1.4kb) library for encoding / decoding morse code messages,unicode supported .
1. Install
npm install xmorse
Or download dist/xmorse.min.js source file。
<script type="text/javascript" src="dist/xmorse.min.js"></script>
var xmorse = require('xmorse');
//or
import xmorse from 'xmorse';
There is only 2 API named encode , decode .
For encode(msg) , example:
// standart morse
xmorse.encode('Hello, Xmorse!');
// unicode
xmorse.encode('コンニチハ, セカイ!');
xmorse.encode('越过长城,走向世界');
For decode(morse) , example:
xmorse.decode('../.-../---/...-/./-.--/---/..-/-/---/---/--...-....-...-/-..---..-.-----/---..-...--...-/-..----.--.....');
npm install
npm test
github地址: https://github.com/hustcc/xmorse