Popular recipes tagged "nodejs" but not "filename"http://code.activestate.com/recipes/tags/nodejs-filename/2011-01-18T22:59:12-08:00ActiveState Code Recipesnicerest: pretty-print JSON output (JavaScript) 2011-01-18T22:59:12-08:00Trent Mickhttp://code.activestate.com/recipes/users/4173505/http://code.activestate.com/recipes/577549-nicerest-pretty-print-json-output/ <p style="color: grey"> JavaScript recipe 577549 by <a href="/recipes/users/4173505/">Trent Mick</a> (<a href="/recipes/tags/curl/">curl</a>, <a href="/recipes/tags/json/">json</a>, <a href="/recipes/tags/node/">node</a>, <a href="/recipes/tags/nodejs/">nodejs</a>, <a href="/recipes/tags/rest/">rest</a>). Revision 3. </p> <p>Save this to "nicerest", <code>chmod +x</code>-it, and pipe your REST API <code>curl</code> calls through this for nicer output. It will notice HTTP headers (curl's <code>-i</code> option) and skips those before attempting to pretty-print the following JSON.</p> <p>Note: This is currently using node 0.2. I should update for 0.3 changes (I think <code>process.openStdin</code> changed).</p> node.js quicklog method to log to a file (JavaScript) 2010-08-11T05:08:57-07:00Trent Mickhttp://code.activestate.com/recipes/users/4173505/http://code.activestate.com/recipes/577351-nodejs-quicklog-method-to-log-to-a-file/ <p style="color: grey"> JavaScript recipe 577351 by <a href="/recipes/users/4173505/">Trent Mick</a> (<a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/nodejs/">nodejs</a>). </p> <p>I tend to have a "quicklog" method for a few of the languages I'm working in to do logging when stdout/stderr isn't necessarily available (GUI app) or convenient (lots of other output on stdout, etc.). My usage with <a href="http://nodejs.org">nodejs</a> was while working on the node REPL. Log output to stdout interfered with the REPL.</p>