"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/fs-extra/lib/json/output-json-sync.js" (8 Mar 2017, 351 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 var fs = require('graceful-fs')
    2 var path = require('path')
    3 var jsonFile = require('./jsonfile')
    4 var mkdir = require('../mkdirs')
    5 
    6 function outputJsonSync (file, data, options) {
    7   var dir = path.dirname(file)
    8 
    9   if (!fs.existsSync(dir)) {
   10     mkdir.mkdirsSync(dir)
   11   }
   12 
   13   jsonFile.writeJsonSync(file, data, options)
   14 }
   15 
   16 module.exports = outputJsonSync