Browse Source

Update json module name;

bjorn 5 years ago
parent
commit
7b4d2e4fc9
2 changed files with 4 additions and 4 deletions
  1. 2 2
      api/init.lua
  2. 2 2
      api/lovr/json/init.lua

+ 2 - 2
api/init.lua

@@ -467,7 +467,7 @@ return {
       name = "json",
       name = "json",
       tag = "library",
       tag = "library",
       summary = "Encodes and decodes JSON.",
       summary = "Encodes and decodes JSON.",
-      description = "The json module exposes functions for encoding and decoding JSON. You can use it by requiring the `json` module.",
+      description = "The json module exposes functions for encoding and decoding JSON. You can use it by requiring the `cjson` module.",
       key = "json",
       key = "json",
       functions = {},
       functions = {},
       objects = {},
       objects = {},
@@ -475,7 +475,7 @@ return {
       external = true,
       external = true,
       examples = {
       examples = {
         {
         {
-          code = "local json = require 'json'\nlocal data = { health = 10, position = { 1, 2, 3 } }\nlocal encoded = json.encode(data)\nprint(encoded)\nlocal decoded = json.decode(encoded)\nprint(decoded.health, unpack(decoded.position))"
+          code = "local json = require 'cjson'\nlocal data = { health = 10, position = { 1, 2, 3 } }\nlocal encoded = json.encode(data)\nprint(encoded)\nlocal decoded = json.decode(encoded)\nprint(decoded.health, unpack(decoded.position))"
         }
         }
       }
       }
     },
     },

+ 2 - 2
api/lovr/json/init.lua

@@ -3,11 +3,11 @@ return {
   summary = 'Encodes and decodes JSON.',
   summary = 'Encodes and decodes JSON.',
   description = [[
   description = [[
     The json module exposes functions for encoding and decoding JSON. You can use it by requiring
     The json module exposes functions for encoding and decoding JSON. You can use it by requiring
-    the `json` module.
+    the `cjson` module.
   ]],
   ]],
   external = true,
   external = true,
   example = [[
   example = [[
-    local json = require 'json'
+    local json = require 'cjson'
     local data = { health = 10, position = { 1, 2, 3 } }
     local data = { health = 10, position = { 1, 2, 3 } }
     local encoded = json.encode(data)
     local encoded = json.encode(data)
     print(encoded)
     print(encoded)