> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Format to JSON Lines (NDJSON)

> Converts the context data objects into NDJSON.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Turns a list of items into NDJSON, also called JSON Lines: one JSON object per line, separated by line breaks. Unlike a single JSON array, this format lets a receiving system read and process one record at a time without loading the whole file, which is why it is popular for streaming data and large exports. This formatter has no settings; give it a list and it writes each item as its own line.

This documentation describes: [Schema](/schemas/serializer/ndjson)

## Sample data

Input:

```json theme={null}
[
    { "sku": "A1", "name": "Wool scarf" },
    { "sku": "B2", "name": "Leather belt" }
]
```

Output (a single text value; `\n` marks the line break between records):

```json theme={null}
"{\"sku\":\"A1\",\"name\":\"Wool scarf\"}\n{\"sku\":\"B2\",\"name\":\"Leather belt\"}"
```

Written out, the two lines read:

```
{"sku":"A1","name":"Wool scarf"}
{"sku":"B2","name":"Leather belt"}
```

```json Configuration theme={null}
{
  "prototype": "ndjson",
  "parameters": {}
}
```
