Skip to content

Input Formats

Thiago Souza edited this page Apr 7, 2018 · 2 revisions

Input Formats

yajs will accept valid JSON as an input. It can either be a single root JSON object or a stream of newline delimited JSON objects.

JSON (application/json)

The root object can either be:

  • An object:
{ "a": { "root": "object" } }
  • An array:
[ { "first": "object" }, { "second": "object" } ]

Newline Delimited JSON (application/ndjson)

It can also process a stream of newlime delimited JSON objects:

{ "a": { "root": "object" } }
[ { "first": "object" }, { "second": "object" } ]
{ "another": "object" }

Triple Double-Quotes Syntax (experimental)

It also has (experimental) support for JSON objects with triple double-quotes such as:

{ "string": """
  Some string with "quoted" stuff
"""}