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

17 lines (12 loc) 351 B
var fs = require('graceful-fs') var path = require('path') var jsonFile = require('./jsonfile') var mkdir = require('../mkdirs') function outputJsonSync (file, data, options) { var dir = path.dirname(file) if (!fs.existsSync(dir)) { mkdir.mkdirsSync(dir) } jsonFile.writeJsonSync(file, data, options) } module.exports = outputJsonSync