okay i have a function within my node.js script using the event stream module.
i can check the line data with the simple script i have below but i want to be able to use each line aswell. example of what i want
line(0) --- first line of stdout
line(1) --- second line of stdout
ect, ect
my script i am using at the moment
function pinstripe() {
es.pipeline(
child.stdout,
es.split(),
es.map(function (line) {
console.log(line);
if (line === 'Captchadone') {
child.stdin.write("hello" + '\n');
}
if (line === 'Input1') {
child.stdin.write("243534:fdghdfgth456:45365" + '\n');
}
})
);
}
then i call it like so
pinstripe();
this works like expected but how do i make the function so i can use it like so ..
function pinstripe() {
es.pipeline(
child.stdout,
es.split(),
es.map(function (line) {
console.log(line);
if (line === 'Captchadone') {
child.stdin.write("hello" + '\n');
child.stdin.write(line(0)); //i want to refrence
child.stdin.write(line(1)); //each line like so
}
if (line === 'Input1') {
child.stdin.write("243534:fdghdfgth456:45365" + '\n');
child.stdin.write(line(2)); //and here
}
})
);
}
obviously this does not work but how can i make it so it does work