CW.js
A comprehensive Morse Code (CW) library
Usage
Node
Install the package via npm
or yarn
:
$ npm install cw
You can then use:
const cw = require("cw");console.log(cw.codes["C"]); // "-.-."
Browser
You can either build the browser bundle yourself with:
$ npm install$ npm run build
Which will create dist/cw.js
and dist/cw.min.js
. Or you can just use it from our CDN:
Once the script is loaded you can call the cw.play()
function:
Options can be passed to customize the played sequence:
cw;
In cases of multiple plays, it is recommended to create a global audioContext
object:
let actx = cw; // tone is passed here cw;cw;cw;
For more examples see the examples/ directory.
Testing
$ npm test
License
ISC