Almost the same as writeJsonSync, except that if the directory does not exist, it's created.
writeJsonSync
import * as fs from 'fs-extra'const file = '/tmp/this/path/does/not/exist/file.json'fs.outputJsonSync(file, {name: 'JP'})const data = fs.readJsonSync(file)console.log(data.name) // => JP Copy
import * as fs from 'fs-extra'const file = '/tmp/this/path/does/not/exist/file.json'fs.outputJsonSync(file, {name: 'JP'})const data = fs.readJsonSync(file)console.log(data.name) // => JP
Generated using TypeDoc
Almost the same as
writeJsonSync
, except that if the directory does not exist, it's created.