1.0.1 • Published 9 years ago

log-return v1.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
9 years ago

Log-return

Let's say you're obnoxious and you write code like this:

function mindWarp (a) {
  var b = a * 2
  // do stuff
  return (
    { c: b
    , d: e
    , f: g
    }
  )
}

But there's a bug in there and you'd like to see it. Easy.

npm i log-return

Then:

var log = require('log-return')

function mindWarp (a) {
  var b = a * 2
  // do stuff
  return log(
    { c: b
    , d: e
    , f: g
    }
  )
}

Your function still does what you want, and you now log the return function.

That's not enough? Check out this nonsense.

var a = 19
var b = 27
var c = a * b
var d = '' + c
var e = d + 9

What is the value of e? Sure, you could just:

console.log(e)

But that is so many characters. How about:

var a = 19
var b = 27
var c = a * b
var d = '' + c
var e = log(d + 9)

You're welcome.