Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tessel-morse

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tessel-morse - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

.npmignore

61

index.js

@@ -16,32 +16,7 @@ var tessel = require('tessel');

var q = async.queue(function(c, callback) {
var onDuration;
var offDuration;
if (c === WORD_DELIMITER) {
onDuration = 0;
offDuration = 7;
} else if (c === '.') {
onDuration = 1;
offDuration = 1;
} else if (c === '-') {
onDuration = 3;
offDuration = 1;
} else if (c === ' ') {
onDuration = 0;
offDuration = 3;
}
if (onDuration > 0) {
ledOn();
}
setTimeout(function() {
ledOff();
setTimeout(function() {
callback();
}, offDuration * DOT_DURATION);
}, onDuration * DOT_DURATION);
}, 1);
function morse_blink(str, options) {
options = options || {};
options.on = options.on || ledOn;
options.off = options.off || ledOff;
if (typeof options.duration === 'number' && !isNaN(options.duration)) {

@@ -53,2 +28,31 @@ DOT_DURATION = options.duration;

}
var q = async.queue(function(c, callback) {
var onDuration;
var offDuration;
if (c === WORD_DELIMITER) {
onDuration = 0;
offDuration = 7;
} else if (c === '.') {
onDuration = 1;
offDuration = 1;
} else if (c === '-') {
onDuration = 3;
offDuration = 1;
} else if (c === ' ') {
onDuration = 0;
offDuration = 3;
}
if (onDuration > 0) {
options.on();
}
setTimeout(function() {
options.off();
setTimeout(function() {
callback();
}, offDuration * DOT_DURATION);
}, onDuration * DOT_DURATION);
}, 1);
var morseStr = morse.encode(str.split(' ')).join(WORD_DELIMITER);

@@ -59,2 +63,3 @@ var arr = morseStr.split('');

}
return morse.encode(str);

@@ -61,0 +66,0 @@ }

{
"name": "tessel-morse",
"version": "0.0.1",
"version": "0.1.0",
"description": "Communicate in Morse code using your Tessel",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,2 +13,4 @@ # tessel-morse

Run the following script on your tessel:
``` js

@@ -20,2 +22,6 @@ var morseBlink = require('tessel-morse');

Look at your Tessel! It should be blinking :)
[See it in action here.](http://www.gfycat.com/OilyPeskyBandicoot)
## Options

@@ -22,0 +28,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc