sys.puts in node.js

sys.puts simply prints the given string in the logs.

But if you want to print a more complex object (Array, JSON, JSObject) you have to use console.log because you want to “look inside” of the object.

sys.puts would give you only “[object object]” for example.

References :

http://stackoverflow.com/questions/3904273/difference-between-console-log-and-sys-puts-in-node-js

to check for debugger for node application :

https://github.com/joyent/node/wiki/using-eclipse-as-node-applications-debugger

Advertisements

About rahul23134654

Hi, I am Rahul Meha , B.E. in (I.T.)
This entry was posted in Node.js. Bookmark the permalink.

2 Responses to sys.puts in node.js

  1. dskanth says:

    Then what about sys.inspect ? You did not explain anything about it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s