Node-fs-extra: Document spaces option for writeJson & outputJson

Created on 5 Jul 2017  路  1Comment  路  Source: jprichardson/node-fs-extra

It would be nice if there is an option for pretty-printing JSON while writing file.

documentation

Most helpful comment

There is an option; it's called spaces.

fs.writeJson(file, {some: 'data'}, {spaces: 2})
.then(() => {
  console.log('success!')
})
.catch(err => {
  console.error(err)
})

This should be documented.

>All comments

There is an option; it's called spaces.

fs.writeJson(file, {some: 'data'}, {spaces: 2})
.then(() => {
  console.log('success!')
})
.catch(err => {
  console.error(err)
})

This should be documented.

Was this page helpful?
0 / 5 - 0 ratings