fork(8) download
  1. -- your code goes heret
  2. local json = require "json"
  3.  
  4. local t = {
  5. ["name1"] = "value1",
  6. ["name2"] = "a \021 string" ,
  7. name3 = json.null
  8. }
  9.  
  10. local encoded = json.encode( t )
  11. local lua_value = JSON:decode(t) -- decode example
  12.  
  13.  
  14. local raw_json_text = JSON:encode(t) -- encode example
  15. local pretty_json_text = JSON:encode_pretty(t)
Runtime error #stdin #stdout #stderr 0s 2784KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
lua: prog.lua:2: module 'json' not found:
	no field package.preload['json']
	no file '/usr/local/share/lua/5.2/json.lua'
	no file '/usr/local/share/lua/5.2/json/init.lua'
	no file '/usr/local/lib/lua/5.2/json.lua'
	no file '/usr/local/lib/lua/5.2/json/init.lua'
	no file '/usr/share/lua/5.2/json.lua'
	no file '/usr/share/lua/5.2/json/init.lua'
	no file './json.lua'
	no file '/usr/local/lib/lua/5.2/json.so'
	no file '/usr/lib/i386-linux-gnu/lua/5.2/json.so'
	no file '/usr/lib/lua/5.2/json.so'
	no file '/usr/local/lib/lua/5.2/loadall.so'
	no file './json.so'
stack traceback:
	[C]: in function 'require'
	prog.lua:2: in main chunk
	[C]: in ?