MorseCode.JS
Simple package to encode/decode morse code.
Installing
$ npm i @devsnowflake/morsecode.js
Example
Encoder
const morse = require("@devsnowflake/morsecode.js");
const message = "This is my message";
const mc = morse.Encode(message);
console.log(mc);
Decoder
const morse = require("@devsnowflake/morsecode.js");
const mc = "- .... .. ... / .. ... / -- -.-- / -- . ... ... .- --. .";
const message = morse.Decode(mc);
console.log(mc);
Audio Encoder
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"));
Join my Discord