Skip to content

Instantly share code, notes, and snippets.

@shiweifu
Created July 16, 2012 10:00
Show Gist options
  • Save shiweifu/3121887 to your computer and use it in GitHub Desktop.
Save shiweifu/3121887 to your computer and use it in GitHub Desktop.
load json
-- author: shiweifu
-- mail: [email protected]
cjson = require("cjson")
function load_json_db( db_name )
local f = io.open(db_name)
local s = f:read("*a")
f:close()
return cjson.decode(s)
end
function main()
local db = load_json_db("videos.db")
end
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment