Parser
Parses a string in JSON, YAML, TOML, or INI format into a structured object.
This node parses a string containing structured data into an object that can be queried by other nodes like Property Getter or converted back to a string with Serializer.
Auto-Detection Logic#
When format is set to auto, the node tries to guess the format based on the first characters of the input string:
- Starts with {: Assumes json.
- Contains [: Assumes toml.
- Contains =: Assumes ini.
- Otherwise: Assumes yaml.
Note: The auto-detector might incorrectly identify a string starting with < as xml, but XML parsing is not supported, which will result in an error.
INI Parsing#
Due to the structure of INI files, the output is a nested object. However, a known issue causes only the last section of the INI file to be included in the output object. The structure will be: {"section_name": {"key1": "value1", "key2": "value2"}}.
Inputs#
| Port | Description |
|---|---|
| Triggers the node to start parsing. | |
| The input string to parse. | |
| The format of the input string. |
Outputs#
| Port | Description |
|---|---|
| Executed on a successful parse. | |
| Executed if parsing fails. | |
| The parsed object. |
ID: core/parser@v1