Skip to content

Commit

Permalink
Use console.log instead of util.puts()
Browse files Browse the repository at this point in the history
Since NodeJS v0.11.3, util.puts becomes deprecated API.
  • Loading branch information
nishidayuya committed Feb 14, 2018
1 parent e558b12 commit 132cab6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions example/demo.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
var sys = require('util');
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;

var xhr = new XMLHttpRequest();

xhr.onreadystatechange = function() {
sys.puts("State: " + this.readyState);
console.log("State: " + this.readyState);

if (this.readyState === 4) {
sys.puts("Complete.\nBody length: " + this.responseText.length);
sys.puts("Body:\n" + this.responseText);
console.log("Complete.\nBody length: " + this.responseText.length);
console.log("Body:\n" + this.responseText);
}
};

Expand Down

0 comments on commit 132cab6

Please sign in to comment.