npm i morse-conv
let morse=require('morse-conv');
let code=morse.text_to_morse("hi suraj");
console.log(code);
let data=morse.morse_to_text(".... .. / - .... .. ... / .. ... / ... ..- .-. .- .--- -.-. .... .- -. -.. .-. .- .--- --- ... .... ..");
console.log(data)
readfile('/home/suraj/Desktop/bigger-packages/morse-conv/LICENCE.md',(err,res)=>{
if(err){
console.log(err);
}
else{
// convert a file's text data into morse code and display it.
// NOTE: it don't change origin file.
console.log(text_to_morse(res));
}
})
let data=morse_to_text(".... .. / - .... .. ... / .. ... / ... ..- .-. .- .--- -.-. .... .- -. -.. .-. .- .--- --- ... .... ..");
save_to_file('/home/suraj/Desktop/output.txt',data);
// if file not exist it will create one.
Author: Surajchandraa
Source Code: https://github.com/Surajchandraa/morse-conv
License: MIT license