Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document spaces option for writeJson & outputJson #456

Closed
sidvishnoi opened this issue Jul 5, 2017 · 1 comment
Closed

Document spaces option for writeJson & outputJson #456

sidvishnoi opened this issue Jul 5, 2017 · 1 comment

Comments

@sidvishnoi
Copy link

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

@RyanZim
Copy link
Collaborator

RyanZim commented Jul 5, 2017

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.

@RyanZim RyanZim changed the title Feature Request: Add indent option in writeJson, outPutJson Document spaces option for writeJson & outputJson Jul 5, 2017
RyanZim added a commit that referenced this issue Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants