New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

morsecodify

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

morsecodify

A morse code practice generator

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

morsecodify

morsecodify is a Node JS app that converts text strings into WAV files containing morse code. There are also a few utilities included here that use the morsecodify module.

Usage

morsecodify exports one function: codify. codify takes several arguments:

  • toneFreq - the frequency of the "sidetone" that's generated.
  • wpm - the words per minute.
  • farnsworth - the wpm to use for the space between characters and words. If this is set, the individual characters are send at the wpm speed, but the slower speed is used between characters and words. If this is not set, "true timing" is used, where all morse code elements (including intra-character and intra-word spaces) are sent the wpm speed.
  • inputText - the text to turn into morse code.
  • callback - uses the Node JS convention of using the first argument for errors, and the second for the buffer object returned from codify.

codify returns the error code (if any), a buffer object cotaining the wav file contents, and the text as translated.

morse = require('morsecodify');

morse.codify(toneFreq, wpm, farnsworth, inputText, function(err, codeBuffer, translated){
    if(err){
        console.error(err);
    } else {
        var file = fs.createWriteStream('morse.wav');
        file.write(codeBuffer);
        file.end();
        console.log('Succesfully created a WAV file containing the morse code for\n' + translated);
    }
});

FAQs

Package last updated on 14 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts