mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
Add p() like in Ruby.
This commit is contained in:
parent
dfde465483
commit
de6036669d
@ -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);
|
||||
}
|
||||
|
||||
@ -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…
Reference in New Issue
Block a user