Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is not meant to displace plain JSON!

JSON5.stringify(obj) produces plain compliant JSON. Using JSON5, programattically produced JSON will always be JSON 1.0. This is for configuration files, and static (hand-edited) data.

And what is wrong with just using ISO dates in strings? I mean whats the difference between, say:

    "date": /2010-03-23T23:57Z/,
    "date": Date(2010-03-23T23:57Z),
or whatever the syntax would be and

    "date": "2010-03-23T23:57Z"
? The irony is that JSON5 without dates is more compatible with JSON, than any JSON implementation with dates. (JSON5.stringify(JSON5.parse(...)) always produces pure JSON without loosing information. I don't know how you would convert a date literal into regular json other than turning it into a string, on the other hand.)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: