This commit is contained in:
Danielv123 committed 2017-06-09 06:58:06 +02:00
1 parent 0ada84e153
commit c24cb51f13
1 file changed
+4 -1
+4 -1
View File
@@ -10,7 +10,10 @@ var config = {};
process.stdin.setEncoding('utf8');
process.stdin.on('readable', () => {
var chunk = process.stdin.read();
if (chunk !== null && isNaN(chunk) && config && !isJson(chunk)&& !chunk.includes("[")){
console.log(chunk)
if (chunk !== null && isNaN(chunk) && config && !isJson(chunk)){
// example chunk Stdout: {1:{inventory:{['iron-ore']:100,['steel-plate']:5800,['iron-ore']:50,},
// requestSlots:{['underground-belt']:50, ['fast-transport-belt']:50, ['express-underground-belt']:50, ['underground-belt']:50, }},}
// returns JS object, throws if there are syntax errors in input string
let inventory = functions.parseJsString(chunk);
console.log(inventory);