Skip to main content
Version: Next

parseEntityYaml()

Home > @backstage/plugin-catalog-node > parseEntityYaml

A helper function that parses a YAML file, properly handling multiple documents in a single file.

Signature:

function parseEntityYaml(data: string | Buffer, location: LocationSpec): Iterable<CatalogProcessorResult>;

Parameters

Parameter

Type

Description

data

string | Buffer

location

LocationSpec

**Returns:**

Iterable<CatalogProcessorResult>

Remarks

Each document is expected to be a valid Backstage entity. Each item in the iterable is in the form of an entity result if the document seemed like a valid object, or in the form of an error result if it seemed incorrect. This way, you can choose to retain a partial result if you want.

Note that this function does NOT perform any validation of the entities. No assumptions whatsoever can be made on the emnitted entities except that they are valid JSON objects.