MCPcopy Index your code
hub / github.com/bronze1man/yaml2json

github.com/bronze1man/yaml2json @v1.3.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.5 ↗ · + Follow
20 symbols 48 edges 7 files 0 documented · 0% updated 8mo agov1.3.5 · 2025-03-11★ 2404 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Description

Transform yaml string to json string without the type infomation.

Features

  • zero config.
  • supports Windows, Linux, macOS, FreeBSD, NetBSD, OpenBSD, Plan 9 etc..

Binary installation and usage

  • Download a binary that match your operation system and platform.
  • https://github.com/bronze1man/yaml2json/releases
  • copy it to /usr/local/bin like (cp ~/Downloads/yaml2json_darwin_amd64 /usr/local/bin/yaml2json )
  • Use chmod +x /usr/local/bin/yaml2json give running permission to it.

mac/linux usage

  • echo "a: 1" | yaml2json
  • yaml2json < 1.yml > 2.json

window usage

  • windows 7 cmd.exe:
C:\tmp>more .\1.yaml
a: 1

C:\tmp>.\yaml2json_windows_amd64.exe < ./1.yaml > 2.json

C:\tmp>more .\2.json
{"a":1}
  • windows 7 powerShell 6.1.7600 file example:
PS C:\tmp> more .\1.yaml
a: 1

PS C:\tmp> Get-Content .\1.yaml | .\yaml2json_windows_amd64.exe > .\2.json
PS C:\tmp> more .\2.json
{"a":1}

Library installation

  • go get -v github.com/bronze1man/yaml2json/y2jLib

Development

  • Follow example is for develop on mac and linux. It should work to windows too. (need change some command line and path to work on windows).
  • You need a golang on your computer. https://golang.org
  • Create a new directory as your workspace, like ~/work/yaml2json
  • Change your current work directory to that directory.
cd ~/work/yaml2json
go get -v github.com/bronze1man/yaml2json
go run github.com/bronze1man/yaml2json/y2jBuilder
  • use the file at ~/work/yaml2json/tmp/file to distribute your binary to others.

Notice

  • if you don't know whether your platform is 386 or amd64, use the 386 build...
  • Library api is not easy to use, it will better in next version.

Reference

  • https://github.com/peter-edge/go-yaml2json
  • https://github.com/go-yaml/yaml
  • https://github.com/bronze1man/json2yaml

Core symbols most depended-on inside this repo

TranslateStream
called by 3
y2jLib/TranslateStream.go
mustCopyFile
called by 2
y2jBuilder/zlib.go
mustDeleteFile
called by 2
y2jBuilder/zlib.go
mustRunCmd
called by 2
y2jBuilder/zlib.go
mustZipDir
called by 1
y2jBuilder/zlib.go
transformData
called by 1
y2jLib/TranslateStream.go
main
called by 0
main.go
main
called by 0
y2jBuilder/main.go

Shape

Function 17
Struct 3

Languages

Go100%

Modules by API surface

main_test.go6 symbols
y2jLib/TranslateStream_test.go4 symbols
y2jBuilder/zlib.go4 symbols
y2jLib/TranslateStream.go2 symbols
y2jBuilder/main.go2 symbols
y2jLib/Translate2.go1 symbols
main.go1 symbols

For agents

$ claude mcp add yaml2json \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page