Skip to content

Commit 93909af

Browse files
author
Nicholas C. Zakas
committed
Ensure output from Node.js CLI can be captured (fixes #175)
1 parent e2a55bb commit 93909af

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,4 @@ June 18, 2011 - v0.2.0
6666
June 15, 2011 - v0.1.0
6767

6868
* Initial release
69+

src/cli/node.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ var fs = require("fs"),
99
cli({
1010
args: process.argv.slice(2),
1111

12-
print: console.log,
12+
print: function(message){
13+
fs.writeSync(1, message + "\n");
14+
fs.fsyncSync(1);
15+
},
1316

1417
quit: function(code){
1518
process.exit(code || 0);

0 commit comments

Comments
 (0)