Skip to content

feat: fromyaml and toyaml - #290

Open
dormeiri wants to merge 2 commits into
itchyny:mainfrom
dormeiri:main
Open

feat: fromyaml and toyaml#290
dormeiri wants to merge 2 commits into
itchyny:mainfrom
dormeiri:main

Conversation

@dormeiri

Copy link
Copy Markdown

toyaml example:

echo '{"fruits":["apple","banana"]}' | gojq '.fruits | toyaml'
# Output: "- apple\n- banana"

fromyaml example:

echo '{"fruits":"- apple\\n- banana"}' | gojq '.fruits | fromyaml'
# Output: ["apple","banana"]

Fixes #277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encode/Decode yaml

1 participant