Skip to content

Commit

Permalink
Release 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bungle committed Sep 28, 2015
1 parent bee9dd7 commit 98c8487
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Changes with lua-resty-prettycjson 1.0 28 Sep 2015

*) Feature: LuaRocks Support via MoonRocks.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,30 @@ Just place [`prettycjson.lua`](https://github.com/bungle/lua-resty-prettycjson/b
somewhere in your `package.path`, preferably under `resty` directory. If you are using OpenResty, the default location
would be `/usr/local/openresty/lualib/resty`.

### Using LuaRocks or MoonRocks

If you are using LuaRocks >= 2.2:

```Shell
$ luarocks install lua-resty-prettycjson
```

If you are using LuaRocks < 2.2:

```Shell
$ luarocks install --server=http://rocks.moonscript.org moonrocks
$ moonrocks install lua-resty-prettycjson
```

MoonRocks repository for `lua-resty-prettycjson` is located here: https://rocks.moonscript.org/modules/bungle/lua-resty-prettycjson.

## Lua API
#### string funtion(tbl, [linefeed = "\n", [indent = "\t", [after_colon = " "]]])

Pretty formats the cJSON output.
Pretty formats the cJSON output. You may pass `linefeed` if you want to use different linefeed
than the default `\n`. If you want to indent with something else than `\t` (a tab) you can pass
that as arguments as well. And if you want to have something else than ` ` (single space) after
colons `:` in json, you can change that as well, try for example `\n`.

##### Example

Expand Down
21 changes: 21 additions & 0 deletions lua-resty-prettycjson-dev-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package = "lua-resty-prettycjson"
version = "dev-1"
source = {
url = "git://github.com/bungle/lua-resty-prettycjson.git"
}
description = {
summary = "JSON Pretty Formatter for Lua cJSON",
detailed = "lua-resty-prettycjson is a JSON Pretty Formatter for Lua cJSON.",
homepage = "https://github.com/bungle/lua-resty-prettycjson",
maintainer = "Aapo Talvensaari <aapo.talvensaari@gmail.com>",
license = "BSD"
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "builtin",
modules = {
["resty.prettycjson"] = "lib/resty/prettycjson.lua"
}
}

0 comments on commit 98c8487

Please sign in to comment.