github.com/tomwright/dasel@v1.27.3/benchmark/tests.txt (about)

     1  START
     2  Root Object
     3  root_object
     4  dasel -f benchmark/data.json
     5  jq '.' benchmark/data.json
     6  yq --yaml-output '.' benchmark/data.yaml
     7  END
     8  START
     9  Top level property
    10  top_level_property
    11  dasel -f benchmark/data.json '.id'
    12  jq '.id' benchmark/data.json
    13  yq --yaml-output '.id' benchmark/data.yaml
    14  END
    15  START
    16  Nested property
    17  nested_property
    18  dasel -f benchmark/data.json '.user.name.first'
    19  jq '.user.name.first' benchmark/data.json
    20  yq --yaml-output '.user.name.first' benchmark/data.yaml
    21  END
    22  START
    23  Array index
    24  array_index
    25  dasel -f benchmark/data.json '.favouriteNumbers.[1]'
    26  jq '.favouriteNumbers[1]' benchmark/data.json
    27  yq --yaml-output '.favouriteNumbers[1]' benchmark/data.yaml
    28  END
    29  START
    30  Append to array of strings
    31  append_array_of_strings
    32  dasel put string -f benchmark/data.json -o - '.favouriteColours.[]' blue
    33  jq '.favouriteColours += ["blue"]' benchmark/data.json
    34  yq --yaml-output '.favouriteColours += ["blue"]' benchmark/data.yaml
    35  END
    36  START
    37  Update a string value
    38  update_string
    39  dasel put string -f benchmark/data.json -o - '.favouriteColours.[0]' blue
    40  jq '.favouriteColours[0] = "blue"' benchmark/data.json
    41  yq --yaml-output '.favouriteColours[0] = "blue"' benchmark/data.yaml
    42  END
    43  START
    44  Overwrite an object
    45  overwrite_object
    46  dasel put object -f benchmark/data.json -o - -t string -t string '.user.name' first=Frank last=Jones
    47  jq '.user.name = {"first":"Frank","last":"Jones"}' benchmark/data.json
    48  yq --yaml-output '.user.name = {"first":"Frank","last":"Jones"}' benchmark/data.yaml
    49  END
    50  START
    51  List keys of an array
    52  list_array_keys
    53  dasel -f benchmark/data.json -m '.-'
    54  jq 'keys[]' benchmark/data.json
    55  yq --yaml-output 'keys[]' benchmark/data.yaml
    56  END
    57  START
    58  Delete property
    59  delete_property
    60  dasel delete -f benchmark/data.json -o - '.id'
    61  jq 'del(.id)' benchmark/data.json
    62  yq --yaml-output 'del(.id)' benchmark/data.yaml
    63  END