Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 699 Bytes

README.md

File metadata and controls

54 lines (40 loc) · 699 Bytes

libyaml -- read/write yaml with bash-oo-framework

dependencies

installation

$ blib install Cj-bc/libyaml

usage

import blib:libyaml

$var:yaml file
$file::__init__ "<file_name>"

$var:file read <key>
$var:file write <key> <value>

example:

$var:yaml file
$file::__init__ "sample.yaml"

$var:file read "class"
# returns:
#   ("math", "science")
$var:file write "class" "new_class"
# will edit "sample.yaml" as:
# class:
#   math:
#     ...
#   science:
#     ...
#   new_class
$var:file write "class.math" "2"
# will edit "sample.yaml" as:
# class:
#   math:
#     3:
#       ...
#     C:
#       ...
#     2