documentit/node_modules/fs-extra/lib/json/output-json-sync.js

17 lines
351 B
JavaScript
Raw Permalink Normal View History

2018-01-05 18:48:13 +00:00
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