const template = require('art-template');
//绝对路径 模板中显示的数据
const path = require('path');const dateFormat = require('dateFormat')
template.defaults.imports.dateFormat = dateFormat;
template.defaults.root = path.join(__dirname);
template.defaults.extname = '.art';
const html = template('07', {time: new Date()});
console.log(html);
07.art
{{dateFormat(time,'yyyy-MM-dd')}}
运行结果