Zuzu::Module::JSON(3)

NAME
Zuzu::Module::JSON - std/data/json bindings for ZuzuScript.

DESCRIPTION
Implements the "std/data/json" module. The importer provides a single class named "JSON". If "JSON::XS" is installed, it will be used as the underlying backend; otherwise "JSON::PP" is used.

CLASSES

  JSON
Constructor options:

•   "utf8" (default true)

•   "pretty" (default false)

•   "canonical" (default false)

Instance methods:

•   encode(value)

    Encodes a ZuzuScript value as JSON text.

•   decode(json)

    Decodes JSON text and returns the corresponding ZuzuScript value.

•   load(path)

    Reads JSON text from a "std/io" "Path" and decodes it. Throws if given anything other than "Path".

•   "dump(path, value)"

    Encodes "value" and writes JSON text to a "std/io" "Path". Throws if given anything other than "Path".

COPYRIGHT AND LICENCE
Zuzu::Module::JSON is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.