All,

Is there a way to stop node from terminating when data is piped to it? I 
tried with -i with no luck.

i.e. the following prints out the input data then stops, whereas I expect 
my readline to kick in:

echo "" | node test.js

```
// test.js
var readline = require('readline'),
    rl = readline.createInterface(process.stdin, process.stdout);

rl.setPrompt('> ')
rl.prompt()

rl.on('line', function(line) {
console.log('Line', line)
}).on('close', function() {
  console.log('Closed');
  process.exit(0);
});

setTimeout(function() {
;['stdin','stdout','stderr'].forEach(function (stream) {
  console.log('Timeout %s is destroyed: %s', stream, 
process[stream].destroyed)
})
}, 100)
```

Thoughts?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to