-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# JSON5 lua | ||
|
||
A native lua module for reading json5, written in rust with mlua and serde. | ||
|
||
## Usage | ||
the json5.dll/dylib/so file must be availible in the lua cpath (e.g. the working directory) | ||
```lua | ||
-- Require gives a function table | ||
json5 = require "json5" | ||
|
||
-- Return a json encoded string from a given value (also valid json5) | ||
json5.encode({ "oh", {hello = "world"}}) -- Returns '["oh",{"hello":"world"}]' | ||
|
||
-- Returns a value representing a given json5 string | ||
json5.decode("[1,2,3,{hello: 'world',},]") -- Returns {1,2,3,{hello = "world"}} | ||
``` |