morse-conv
v1.1.0
Published
Using this npm package you can encode or decode the morse data.
Downloads
11
Maintainers
Readme
morse-conv
- Encode or Decode morse data and text.
Installation:
npm i morse-conv
Features:
- convert morse code into text.
- convert text into morsecode.
- Directly read file data and convert it into morse or text.
- Directly save output into desired file.
Functions available:
- text_to_morse("text");
let morse=require('morse-conv'); let code=morse.text_to_morse("hi suraj"); console.log(code);
- morse_to_text("morse code");
let data=morse.morse_to_text(".... .. / - .... .. ... / .. ... / ... ..- .-. .- .--- -.-. .... .- -. -.. .-. .- .--- --- ... .... .."); console.log(data)
- readfile(path,callback);
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)); } })
- save_to_file(path,data);
let data=morse_to_text(".... .. / - .... .. ... / .. ... / ... ..- .-. .- .--- -.-. .... .- -. -.. .-. .- .--- --- ... .... .."); save_to_file('/home/suraj/Desktop/output.txt',data); // if file not exist it will create one.