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

gatenu-npm

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatenu-npm - npm Package Compare versions

Comparing version 1.1.0 to 1.2.1

bin/gatenu

12

device-manager.js

@@ -28,3 +28,7 @@ var fs = require('fs-extra');

function setupAndStartDevice(device) {
setupDevice(device, startDevice);
setupDevice(device, function(error, device) {
if (!error) {
startDevice(device);
}
});
}

@@ -50,2 +54,4 @@

console.error(error);
callback(error);
return;
}

@@ -56,3 +62,3 @@ fs.copySync(path.join(devicePathTmp, 'node_modules', device.connector), devicePath);

if (callback) {
callback(device);
callback(null, device);
}

@@ -72,3 +78,3 @@ });

errFile: devicePath + '/forever.stderr',
command: '"' + path.join(config.nodePath, 'npm') + '"'
command: path.join(config.nodePath, 'npm')
});

@@ -75,0 +81,0 @@

@@ -5,7 +5,22 @@ var skynet = require('skynet');

var skynetConnection = skynet.createConnection({ uuid: config.uuid, token: config.token });
var deviceManager = require('./device-manager')(config);
var deviceManager = require('./device-manager')({
uuid: config.uuid,
token: config.token,
devicePath: config.devicePath,
tmpPath: config.tmpPath,
nodePath: config.nodePath
});
if (!config.uuid) {
skynetConnection.register({type: 'gateway'}, function(data){
skynetConnection.identify({uuid: data.uuid, token: data.token});
skynetConnection.on('notReady', function(data) {
console.log('notReady', data);
if (!config.uuid) {
skynetConnection.register({type: 'gateway'}, function(data){
skynetConnection.identify({uuid: data.uuid, token: data.token});
});
}
});
var refreshDevices = function() {
skynetConnection.whoami({}, function(data){
deviceManager.refreshDevices(data.devices);
});

@@ -15,10 +30,13 @@ }

skynetConnection.on('ready', function(data){
deviceManager.refreshDevices(data.devices);
refreshDevices();
});
skynetConnection.on('message', function(message){
if( deviceManager[message.topic] ) {
deviceManager[message.topic](message.payload);
}
});
if (message.topic === 'refresh') {
refreshDevices();
}
if( deviceManager[message.topic] ) {
deviceManager[message.topic](message.payload);
}
});
};
{
"name": "gatenu-npm",
"version": "1.1.0",
"version": "1.2.1",
"description": "",

@@ -25,3 +25,6 @@ "main": "index.js",

"skynet": "^1.1.1"
},
"optionalDependencies": {
"commander": "^2.3.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