Skip to content

Instantly share code, notes, and snippets.

@temsa
Created August 7, 2012 09:36
Show Gist options
  • Save temsa/3283855 to your computer and use it in GitHub Desktop.
Save temsa/3283855 to your computer and use it in GitHub Desktop.
small node debug snippet
require('colors')
var util = require('util')
function inspect (inspected) {return util.inspect(inspected,true,5,true)}
function log(key,value) {console.log(('\n'+key+':').bold.red, inspect(value),'\n')}
function proxy(fn) {return function proxyfier(){log('proxy args',arguments); var res=fn.apply(this,arguments); log('proxy res', res); return res}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment