Browse Source

Add p() like in Ruby.

v0.7.4-release
Ryan 16 years ago
parent
commit
de6036669d
  1. 4
      src/file.js
  2. 2
      test/test_http.js

4
src/file.js

@ -131,3 +131,7 @@ stdin.fd = File.STDIN_FILENO;
this.puts = function (data, callback) {
stdout.puts(data, callback);
}
this.p = function (data, callback) {
puts(JSON.stringify(data), callback);
}

2
test/test_http.js

@ -1,4 +1,4 @@
puts(JSON.stringify({hello: "world"}));
p({hello: "world"});
new node.http.Server(function (msg) {
setTimeout(function () {
msg.sendHeader(200, [["Content-Type", "text/plain"]]);

Loading…
Cancel
Save