https://github.com/yaml/go-yaml-node
https://github.com/yaml/go-yaml-node
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/yaml/go-yaml-node
- Owner: yaml
- License: apache-2.0
- Created: 2025-06-09T20:42:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-10T14:24:12.000Z (about 1 year ago)
- Last Synced: 2025-06-10T15:38:47.516Z (about 1 year ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- License: License
Awesome Lists containing this project
README
go-yaml-node
============
Load a YAML file and print the nodes
## Description
This program is extremely useful for understanding / debugging how
[go-yaml](https://github.com/yaml/go-yaml) loads YAML documents.
The `Unmarshal` function loads YAML documents into a `Node` data type.
This program will read YAML from stdin and print the nodes in an indented tree
format, showing all the (non-empty) field values.
## Usage
Example:
```
$ go-yaml-node <<< 'scalar forms: [null, true, yes, 0xcafe, 0o123, 12:34:56]'
kind: Document
content:
- kind: Mapping
content:
- kind: Scalar
text: scalar forms
- kind: Sequence
style: Flow
content:
- kind: Scalar
tag: '!!null'
text: "null"
- kind: Scalar
tag: '!!bool'
text: "true"
- kind: Scalar
text: "yes"
- kind: Scalar
tag: '!!int'
text: "0xcafe"
- kind: Scalar
tag: '!!int'
text: "0o123"
- kind: Scalar
text: "12:34:56"
```
## Installation
```
make install PREFIX=
```
## Testing
```
make test
make test file=test/file-002.yaml
```
No deps required.
On first run this will install Go locally.
This should install all deps including a local installation of Go.
## Installation
```
go install github.com/ingydotnet/go-yaml-node@latest
```
## License
Copyright 2025 - Ingy döt Net
This project is licensed under the Apache License, Version 2.0.
See the [LICENSE](LICENSE) file for details.