Proyectos
Ver en GitHub
craigmj/json4lua
craigmj/json4lua has 292 GitHub stars and 159 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-20 16:17 UTC. Last push 2024-10-02.
Crecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- Recopilando historial
- in 15 days
- Recopilando historial
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
Acerca de
JSON (Javascript Object Notation - http://www.json.org) encoding / decoding module for Lua, and very basic JSON RPC module (requiring socket 2.0).Module requires compat-5.1 if using Lua 5.0.This repository was converted from a CVS repository on luaforge.net on Jan. 20, 2010.
Herramientas de desarrolloREADME.md
Originaljson4lua
JSON and JSONRPC for Lua
Installation
luarocks install --server=http://rocks.moonscript.org/manifests/amrhassan --local json4Lua
JSON Usage
Encoding
json = require('json')
print(json.encode({ 1, 2, 'fred', {first='mars',second='venus',third='earth'} }))
[1,2,"fred", {"first":"mars","second":"venus","third":"earth"}]
Decoding
json = require("json")
testString = [[ { "one":1 , "two":2, "primes":[2,3,5,7] } ]]
decoded = json.decode(testString)
table.foreach(decoded, print)
print ("Primes are:")
table.foreach(decoded.primes,print)
one 1
two 2
primes table: 0032B928
Primes are:
1 2
2 3
3 5
4 7
JSONRPC Usage
json = require('json')
require("json.rpc")
server = json.rpc.proxy("http://jsolait.net/testj.py")
result, error = server.echo('Test echo!')
print(result)
Test echo!