source: trip-planner-front/node_modules/fs-extra/lib/json/output-json-sync.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 375 bytes
Line 
1'use strict'
2
3const fs = require('graceful-fs')
4const path = require('path')
5const mkdir = require('../mkdirs')
6const jsonFile = require('./jsonfile')
7
8function outputJsonSync (file, data, options) {
9 const dir = path.dirname(file)
10
11 if (!fs.existsSync(dir)) {
12 mkdir.mkdirsSync(dir)
13 }
14
15 jsonFile.writeJsonSync(file, data, options)
16}
17
18module.exports = outputJsonSync
Note: See TracBrowser for help on using the repository browser.