Comparing version 0.1.5 to 0.1.6
@@ -121,3 +121,3 @@ var fs = require('fs'), | ||
exports.includeActions=function (file, callback) { | ||
exports.includeActions = function (file, callback) { | ||
switch (typeof (file)) | ||
@@ -292,3 +292,3 @@ { | ||
if (!handle) { | ||
callback (JSON.stringify({status : 'not found'})); | ||
callback ({status : 'not found'}); | ||
} | ||
@@ -302,6 +302,6 @@ var processToKill = handle.childProcess; | ||
console.log('killed process ' + (pid+1)); | ||
callback (JSON.stringify({status : 'killed'})); | ||
callback ({status : 'killed'}); | ||
}); | ||
} else { | ||
callback (JSON.stringify({status : 'not existent'})); | ||
callback ({status : 'not existent'}); | ||
} | ||
@@ -311,4 +311,5 @@ return; | ||
default: | ||
// we need to remove circular dependencies before sending the list | ||
var cache = []; | ||
callback(JSON.stringify(ongoingActions, | ||
var objString = JSON.stringify(ongoingActions, | ||
function(key, value) { | ||
@@ -318,10 +319,12 @@ if (typeof value === 'object' && value !== null) { | ||
// Circular reference found, discard key | ||
return; | ||
return; | ||
} | ||
// Store value in our collection | ||
cache.push(value); | ||
cache.push(value); | ||
} | ||
return value; | ||
})); | ||
return value; | ||
} | ||
); | ||
cache = null; | ||
callback(JSON.parse(objString)); | ||
return; | ||
@@ -676,3 +679,3 @@ } | ||
} | ||
callback(JSON.stringify(response)); | ||
callback(response); | ||
}); | ||
@@ -716,3 +719,3 @@ }; | ||
} | ||
callback(null, JSON.stringify(files)); | ||
callback(null, files); | ||
}], | ||
@@ -719,0 +722,0 @@ function (error, message) { |
{ | ||
"name": "cl-rpc", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "A simple rpc module that launches command-line programms", | ||
@@ -5,0 +5,0 @@ "main": "cl-rpc.js", |
23961
888