How to use the node-cmd.run function in node-cmd

To help you get started, we’ve selected a few node-cmd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mosaicdao / mosaic.js / tools / setup / service_manager.js View on Github external
startGeth: function(chain, purpose) {
    const oThis = this
    ;

    // start geth
    logger.info("* Starting " + chain + " chain");
    const cmd = oThis._startGethCommand(chain, purpose);
    logger.info(cmd);
    shellAsyncCmd.run(cmd);
  },
github legotheboss / YouTube-files / Fan_accessory.js View on Github external
setSpeed: function(value) {
    console.log("Setting fan rSpeed to %s", value);
    CEILING_FAN.rSpeed = value;
    if (value > 0 && value < 33) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan1.py');
    } else if (value == 0) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan0.py');
    } else if (value > 34 && value < 66) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan2.py');
    } else  if (value > 67 && value < 101) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan3.py');
    }
  },
  identify: function() {
github legotheboss / YouTube-files / Fan_accessory.js View on Github external
setSpeed: function(value) {
    console.log("Setting fan rSpeed to %s", value);
    CEILING_FAN.rSpeed = value;
    if (value > 0 && value < 33) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan1.py');
    } else if (value == 0) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan0.py');
    } else if (value > 34 && value < 66) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan2.py');
    } else  if (value > 67 && value < 101) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan3.py');
    }
  },
  identify: function() {
github legotheboss / YouTube-files / Garage Solution / Sensorless / Multiple Garages / newGarage.js View on Github external
open: function() {
    console.log("Opening the Garage!");
    cmd.run('sudo python /home/pi/HAP-NodeJS/python/garage2.py');
  },
  close: function() {
github legotheboss / YouTube-files / Garage Solution / Sensorless / GarageDoorOpener_accessory(NEW).js View on Github external
open: function() {
    console.log("Opening the Garage!");
    cmd.run('sudo python /home/pi/HAP-NodeJS/python/garage.py');
    GARAGE_DOOR.opened = true;
  },
  close: function() {
github nicolasbettag / fucknode / lib / index.js View on Github external
var fucknode = function(name) {
	if (fs.existsSync('node_modules')) {
		cmd.get(
			'pwd',
			function(err, data, stderr) {
				var fuckbreak = data.replace(/\n|\r/g, "");
				console.log("🤦‍  removing node_modules in " + fuckbreak + "\n🤦‍  and force npm install\n");
			}
		);

		cmd.run('rm -r node_modules');
		cmd.run('npm install');

		var undefined = '';
		return undefined;
	} else {
		return "\n" + cool() + "\nfucknode isn't able to find your node_modules\n" + cool() + "\n";
	}
};
github legotheboss / YouTube-files / Fan_accessory.js View on Github external
setSpeed: function(value) {
    console.log("Setting fan rSpeed to %s", value);
    CEILING_FAN.rSpeed = value;
    if (value > 0 && value < 33) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan1.py');
    } else if (value == 0) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan0.py');
    } else if (value > 34 && value < 66) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan2.py');
    } else  if (value > 67 && value < 101) {
      cmd.run('sudo python /home/pi/HAP-NodeJS/python/fan3.py');
    }
  },
  identify: function() {
github PortalNetwork / kaizen-cli / src / lib / plugin / add.js View on Github external
ncp('./temp-noia-sdk/packages', './', function (error) {
        if (error) {
          handleError(error);
          return;
        }
        cmd.run('rm -rf ./temp-noia-sdk');
        updateConfig(kaizenConfig, 'NOIA');
      });
    });
github mosaicdao / mosaic.js / tools / setup / service_manager.js View on Github external
stopGeth: function() {
    logger.info("* Stopping all running geths");
    const cmd = "ps -ef | grep 'openst-setup\\|openst-platform' | grep 'geth ' |  grep -v grep | awk '{print $2}' | xargs kill";
    shellAsyncCmd.run(cmd);
  },
github mosaicdao / mosaic.js / tools / setup / service_manager.js View on Github external
stopExecutable: function() {
    logger.info("* Stopping all running executable");
    const cmd = "ps -ef | grep 'openst-setup\\|openst-platform' | grep 'executables' |  grep -v grep | awk '{print $2}' | xargs kill";
    shellAsyncCmd.run(cmd);
  },

node-cmd

Simple commandline/terminal/shell interface to allow you to run cli or bash style commands as if you were in the terminal.

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular node-cmd functions