mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
Use streams for stdout and stdin
This commit is contained in:
parent
cbfd4da818
commit
fdf46a65c9
8 changed files with 76 additions and 186 deletions
|
@ -2,23 +2,23 @@ var events = require('events');
|
|||
|
||||
exports.print = function () {
|
||||
for (var i = 0, len = arguments.length; i < len; ++i) {
|
||||
process.stdio.write(arguments[i]);
|
||||
process.stdout.write(arguments[i]);
|
||||
}
|
||||
};
|
||||
|
||||
exports.puts = function () {
|
||||
for (var i = 0, len = arguments.length; i < len; ++i) {
|
||||
process.stdio.write(arguments[i] + '\n');
|
||||
process.stdout.write(arguments[i] + '\n');
|
||||
}
|
||||
};
|
||||
|
||||
exports.debug = function (x) {
|
||||
process.stdio.writeError("DEBUG: " + x + "\n");
|
||||
process.binding('stdio').writeError("DEBUG: " + x + "\n");
|
||||
};
|
||||
|
||||
exports.error = function (x) {
|
||||
for (var i = 0, len = arguments.length; i < len; ++i) {
|
||||
process.stdio.writeError(arguments[i] + '\n');
|
||||
process.binding('stdio').writeError(arguments[i] + '\n');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue