0
を実行含まれている場合、私は次のスクリプトがありますNodeJS文字列がスクリプト
function execute(){
require("fs").readFile("sometextfile.txt", function(err, cont) {
if (err)
throw err;
console.log("ALERT:"+(cont.indexOf("mystring")>-1 ? " " : " not ")+"found!");
});
}
setInterval(execute,9000);
を、私は文字列が含まれている場合にのみJavaScriptを実行したい「警告:!見つかりました」
スクリプト:
var Prowl = require('node-prowl');
var prowl = new Prowl('API');
prowl.push('ALERT', 'ALERT2', function(err, remaining){
if(err) throw err;
console.log('I have ' + remaining + ' calls to the api during current hour. BOOM!');
});
ヘルプ!
あなたは自分のコードからどのような出力を得ていますか? –