https://github.com/nvim-neorg/norgopolis-client.lua
A lua bridge for the Norgopolis client rust module.
https://github.com/nvim-neorg/norgopolis-client.lua
Last synced: about 1 year ago
JSON representation
A lua bridge for the Norgopolis client rust module.
- Host: GitHub
- URL: https://github.com/nvim-neorg/norgopolis-client.lua
- Owner: nvim-neorg
- License: mit
- Created: 2023-09-08T18:36:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-21T17:12:13.000Z (over 2 years ago)
- Last Synced: 2025-02-26T15:28:38.818Z (over 1 year ago)
- Language: Rust
- Size: 102 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# A Lua API for Norgopolis Clients
For information about Norgopolis, consult https://github.com/nvim-neorg/norgopolis.
This repository acts as a wrapper around https://github.com/nvim-neorg/norgopolis-client for Lua.
Any Lua application may install this repository as a dependency and communicate with Norgopolis
and its modules.
# Installation
```sh
luarocks --local install norgopolis-client.lua
```
# Usage
`norgopolis-client.lua` exposes a very simple yet extendable API:
```lua
-- Connect to Norgopolis. The port number may be omitted and will default to 62020.
local norgopolis = require("norgopolis").connect("localhost", "62020")
-- Invoke a function of a given module. The third argument is the parameters to send
-- over to the module. It may be nil or any inbuilt Lua datatype.
-- This will most commonly be a table.
norgopolis:invoke("module-name", "function-name", "hello!", function(ret)
-- This function gets invoked every time a module responds back with a response
-- packet. `ret` could be anything, so be careful!
print(ret)
end)
```