summaryrefslogtreecommitdiffhomepage
path: root/libs/luci-lib-jsonc/src/jsonc.luadoc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/luci-lib-jsonc/src/jsonc.luadoc')
-rw-r--r--libs/luci-lib-jsonc/src/jsonc.luadoc14
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/luci-lib-jsonc/src/jsonc.luadoc b/libs/luci-lib-jsonc/src/jsonc.luadoc
index 2ee9cebdc8..720b17d1eb 100644
--- a/libs/luci-lib-jsonc/src/jsonc.luadoc
+++ b/libs/luci-lib-jsonc/src/jsonc.luadoc
@@ -121,10 +121,22 @@ parser:set({ "some", "data" })`
]]
---[[
-Serialize current parser state as JSON.
+Generate an ltn12-compatible sink.
@class function
@sort 4
+@name parser.sink
+@return Returns a function that can be used as an ltn12 sink.
+@usage `parser = luci.jsonc.new()
+ltn12.pump.all(ltn12.source.file(io.input()), parser:sink())
+print(parser:get())`
+]]
+
+---[[
+Serialize current parser state as JSON.
+
+@class function
+@sort 5
@name parser.stringify
@param pretty A boolean value indicating whether the resulting JSON should be pretty printed.
@return Returns the serialized JSON data of this parser instance.