minetest.parse_json

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

minetest.parse_json(string[, nullvalue])

Description

Returns something.

  • Converts a string containing JSON data into the Lua equivalent
  • nullvalue: returned in place of the JSON null; defaults to nil
  • On success returns a table, a string, a number, a boolean or nullvalue
  • On failure outputs an error message and returns nil

Example

minetest.parse_json("[10, {\"a\":false}]") -- returns {10, {a = false}}
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox