Motivation: JSON doesn't support serializing functions, dates, or regular expressions. I wanted a quick and simple way to push trusted data structures with code from Node down to the browser.
This should make it easier to share code and modules between the server and client.
npm install tosource
The following code:
var toSource =console
See test.js for more examples.
func.toString(), no closure properties are serialized
toSource is open source software under the zlib license.