Methods

parseΒΆ

parse(s:Str, hints:Hash)

Attempt to parse JSON. Uses decode_json().
Source: stdlib.ngs:3393

parse(s:Str, hints:Hash)

EXPERIMENTAL. KVS (key-value separator) hint for parse()
Source: stdlib.ngs:3402

Example

parse('a b\nc d', {'KVS': ' '}) == {'a': 'b', 'c': 'd'}

parse(s:Str, hints:Hash)

EXPERIMENTAL. FS (field separator) hint for parse()
Source: stdlib.ngs:3411

Example

parse('a b\nc d', {'FS': ' '})  # [['a', 'b'], ['c', 'd']]

parse(s:Str, hints:Hash)

Handle fields_names hint - run parse() and make Arr[Hash] from Arr[Arr] using provided fields_names
Source: stdlib.ngs:3420

Example

backup_list = fetch('backup.list', {'FS': ' ', 'fields_names': %[env role]})

parse(s:Str, hints:Hash)

Parse the output of "aws" command. Extracts the array (see "s" below"). For "describe-instances", flattens the instance list.
Source: stdlib.ngs:3484

s

Str containing JSON with a Hash at top level with exactly one Arr as value

hints

hints.process.command.argv[0] must be 'aws'

Returns

data structure, tyically an Arr at top level. If s is empty string - null.

parse(s:Str, hints:Hash)

Parse the output of "find" command which does not use "-printf". Handles "-print0".
Source: stdlib.ngs:3514

hints

hints.process.command.argv[0] must be 'find'

Returns

Arr of Str