From 32b57dac838d7cbece250aa8ce42b788750ba857 Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Tue, 3 Jan 2012 21:30:39 +1030 Subject: Rename encode/decode scripts to lua2json/json2lua --- tests/json2lua.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 tests/json2lua.lua (limited to 'tests/json2lua.lua') diff --git a/tests/json2lua.lua b/tests/json2lua.lua new file mode 100755 index 0000000..050b89d --- /dev/null +++ b/tests/json2lua.lua @@ -0,0 +1,14 @@ +#!/usr/bin/env lua + +-- usage: json2lua.lua [json_file] +-- +-- Eg: +-- echo '[ "testing" ]' | ./json2lua.lua +-- ./json2lua.lua test.json + +local json = require "cjson" +local misc = require "cjson-misc" + +local json_text = misc.file_load(arg[1]) +local t = json.decode(json_text) +print(misc.serialise_value(t)) -- cgit v1.2.3-55-g6feb