1.0.3 • Published 7 years ago

i-process v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

i-process

NPM

Installing

npm install --save i-process

Usage examples

Linux shell

var iProcess = require("i-process");

// create check function 
var Hash = function (name, callback) {
	var result = false;
	var hash   = new iProcess("bash", ["./hash.bash", name]);

	hash.on("line", function (line) {
		if (line.indexOf("true") !== -1) result = true;
	});

	hash.on("error", function (data) {
		throw new Error;
	});

	hash.on("close", function () {
		callback(result);
	});
};

// usage
Hash("nmap", function (result) {
	if (result) {
		//...
	}
});

hash.bash source:

#!/bin/bash

hash $1 2>/dev/null && echo "true"

Chess engine

var stockfish = new iProcess("./stockfish_8_x64");

stockfish.on("line", function (line) {
	//...
});

stockfish.write("position startpos\n");
stockfish.write("go movetime 10000\n");
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago