initial commit

This commit is contained in:
dude
2026-09-01 18:33:56 +00:00
commit c24449ee0a
2761 changed files with 302737 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# outputJson(file, object, [options], callback)
Almost the same as [`writeJson`](writeJson.md), except that if the directory does not exist, it's created.
`options` are what you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback).
**Alias:** `outputJSON()`
- `file` `<String>`
- `object` `<Object>`
- `options` `<Object>`
- `callback` `<Function>`
## Example:
```js
const fs = require('fs-extra')
const file = '/tmp/this/path/does/not/exist/file.json'
fs.outputJson(file, {name: 'JP'}, err => {
console.log(err) // => null
fs.readJson(file, (err, data) => {
console.log(data.name) // => JP
})
})
```