json - Evaluate custom javascript method (CircularJSON) with Jade -
i want parse object client-side javascript through jade. work: script var object = json.parse(#{json.stringify(object)}); but object circular , need this script var object = circularjson.parse(#{circularjson.stringify(object)}); but throws error cannot call method 'stringify' of undefined which guess because jade doesn't recognise circularjson method. way make it? it require d , passed in locals response.render("index.jade", {circularjson : require('circular-json')}); or defined function in scope of jade - var circularjson = function(e,t){function l(e,t,o){var u=[],...//whole function script var player = circularjson.parse('!{circularjson.stringify(player)}');