finnp / ndjson-spec-old

Let's try to do a specification for newline delimited JSON
0 stars 0 forks source link

First Ideas #1

Open finnp opened 10 years ago

finnp commented 10 years ago

The specification should be called Newline Delimited JSON short NDJSON with the filename extension .ndjson. This way it can not be easily confused with JSON-LD, the name is not commonly used for something else and compared to .ndj or .ldj it is easier to recognize as something that is essentially JSON.

I think it should be quite flexible but also easy to parse. This is why imo new lines shouldn't be allowed within the JSON objects. Also I think \r\n, \n, as well as probably \r should be allowed as new line seperators.

Basically I feel like implementing a parser should be as easy as

'{"a": 1}\r{"a":2}'.split(/[\n\r]/).map(function(json) { return JSON.parse(json) })

Resources

paulfitz commented 10 years ago

For resources, there's also this: https://github.com/ldjson/ldjson-spec/blob/master/specification_draft2.md - although I think this shares lineage with the wikipedia page

finnp commented 10 years ago

@paulfitz Thanks for pointing me there btw :)

paulfitz commented 10 years ago

@finnp thanks for working on this :) - looks like you are pulling a lot of threads together.