json.js
333 Bytes
/**
* guang
* @author: lcy<chuanyang.liu@yoho.cn>
* @date: 2016/09/01
*/
'use strict';
let exphbs = require('express-handlebars').create(),
Handlebars = exphbs.handlebars;
Handlebars.registerHelper('json', function(json){
return new Handlebars.SafeString(JSON.stringify(json));
});
module.exports = exphbs.handlebars;