aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlexander Pickering <alex@cogarr.net>2020-09-16 17:18:38 -0400
committerAlexander Pickering <alex@cogarr.net>2020-09-16 17:18:38 -0400
commit41ef510ce2fbaa25d8808250f00966baf0cb9b12 (patch)
treee96a1d300955d23e9396b98579c05f00ca3759a8 /README.md
parent105ea66aba31825512fea8f281b67f9c2a1d79a5 (diff)
downloadlua-nng-41ef510ce2fbaa25d8808250f00966baf0cb9b12.tar.gz
lua-nng-41ef510ce2fbaa25d8808250f00966baf0cb9b12.tar.bz2
lua-nng-41ef510ce2fbaa25d8808250f00966baf0cb9b12.zip
Fix readme
Readme contains an explicit example, but it was broken.
Diffstat (limited to 'README.md')
-rw-r--r--README.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/README.md b/README.md
index af9b5d4..813090a 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ This is a simple binding of [Nanomessage Next Generation](https://github.com/nan
## Installation
-The easiest way to download lua-nng is with [luarocks](https://github.com/luarocks/luarocks)
+The easiest way to download lua-nng is with [luarocks](https://github.com/luarocks/luarocks).
```
luarocks install --server=http://rocks.cogarr.net lua-nng
@@ -12,6 +12,8 @@ luarocks install --server=http://rocks.cogarr.net lua-nng
## Example
+ local nng = require("nng")
+
local s1 = nng.pair1_open()
local s2 = nng.pair1_open()
@@ -19,9 +21,7 @@ luarocks install --server=http://rocks.cogarr.net lua-nng
s2:dial("ipc://tmp/pair.ipc")
s2:send("hello")
- print(s1:recv())
-
-prints "hello"
+ print(s1:recv()) --prints "hello"
For more examples, see spec/start\_spec.lua