GeezerVison is showing github.com — JSON Stringify indentation not working · Issue #10995 · nodejs/node
JSON Stringify indentation not working #10995Labels questionIssues asking questions about Node.js. Description
- Version: 7.4.0
- Platform: Windows (64-bit)
It appears this doesn't work anymore:
JSON.stringify({name: 'test'}, null, 4)
Output stays minified. Activityvsemozhetbyt commented on Jan 25, 2017 If you try this simple evaluation in REPL, you will get a 'debug` output. Try this:
console.log(JSON.stringify({name: 'test'}, null, 4));mscdex commented on Jan 25, 2017 It works for me:
> JSON.stringify({name: 'test'}, null, 4)
'{\n "name": "test"\n}'
> console.log(JSON.stringify({name: 'test'}, null, 4))
{
"name": "test"
}
undefined
>
Is that what you're seeing @adi518 ? osmanmesutozcan commented on Jan 26, 2017 Here also works:
> JSON.stringify({name: 'test'}, null, 4)
'{\n "name": "test"\n}'
> console.log(JSON.stringify({name: 'test'}, null, 4))
{
"name": "test"
}
undefined
>
Platform: macOS. adi-works commented on Jan 26, 2017 Nope, still doesn't work whatsoever. It used to work just fine some months ago. vsemozhetbyt commented on Jan 26, 2017 @adi518 Could you please describe in detail how do you launch the code and what output you get literally? Fishrock123 commented on Jan 26, 2017 @adi518 can you try it in the REPL? (Launch node without a file) adi-works commented on Jan 26, 2017 Ok, found the culprit. I had a JSON.stringify polyfill that messed it up. So sorry. Reacted by Vse Mozhe Buty and Osman Mesut OZCAN
MetadataMetadataquestionIssues asking questions about Node.js. DevelopmentNo branches or pull requestsIssue actions
|