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