function heredoc(fn) {
    var s = fn.toString().replace("function () {\n", "");
    return s.substring(0, s.length-2)
}

var $setting = heredoc(function(){
 'ui';
 ui.layout("xxx");
});

console.log($setting);