I want to use json2 as JSON.parse in node.js, (forgive the stupid question) I can't quite figure out how to use it. I have a copy of json2.js, with the first line removed in my current working directory. Then, from the node.js shell i do:
> orig_func = JSON.parse
[Function: parse]
> require('json2')
{ JSON: {} }
> orig_func === JSON.parse
true
I thought from the comments in the code that by requiring the file it would override the current global JSON object.