UNPKG

charlike

Version:

Small, fast, simple and streaming project scaffolder for myself, but not only. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options

15 lines (12 loc) 314 B
'use strict'; var fs = require('fs'); var stripBom = require('strip-bom'); module.exports = function (module, filename) { var content = fs.readFileSync(filename, 'utf8'); try { module.exports = JSON.parse(stripBom(content)); } catch (err) { err.message = filename + ': ' + err.message; throw err; } };