Simple package to encode/decode morse code.
$ npm i @devsnowflake/morsecode.js
const morse = require("@devsnowflake/morsecode.js");
const message = "This is my message";
const mc = morse.Encode(message);
console.log(mc);
// - .... .. ... / .. ... / -- -.-- / -- . ... ... .- --. .
const morse = require("@devsnowflake/morsecode.js");
const mc = "- .... .. ... / .. ... / -- -.-- / -- . ... ... .- --. .";
const message = morse.Decode(mc);
console.log(mc);
// this is my message
Note: Audio encoder is currently not accurate and might not work properly.
const morse = require("@devsnowflake/morsecode.js");
const fs = require("fs");
const message = "This is my message";
const mc = morse.Encode(message);
const audio = morse.CreateAudio(mc);
audio.pipe(fs.createWriteStream("./morse.mp3"));