Project xmorse is a pure JavaScript (1.5 kb) library for encoding/decoding morse code messages, unicode supported.
项目 xmorse 是一个 JavaScript 开发的摩斯密码编码库(1.5 kb),可以支持 unicode,例如中文摩斯密码。
npm install xmorse
Then import it.
// import library use script tag. <script type="text/javascript" src="dist/xmorse.min.js"></script> // or ES6 style. var WordWidth = require('xmorse');
xmorse.encode('Hello, Xmorse!'); // unicode xmorse.encode('コンニチハ, セカイ!'); xmorse.encode('越过长城,走向世界'); xmorse.decode('../.-../---');
The code of xmorse hosted on Github, click here. Welcome to issue or pull request.