{"id":"post-ill/remote","name":"remote","scope":"post-ill","platform":"roblox","description":"General purpose, minimal remote abstraction for Roblox.","version":"1.0.0","latest":"1.0.0","versions":["1.0.0"],"license":"Unlicense","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"24b3f45a9a63aa514119034d5041ffc3525bce3b74e9f96c756106c8017e7418","likes":0,"downloads":0,"install":"forest install post-ill/remote","url":"https://forest.dev/p/roblox/post-ill/remote","files":"https://api.forest.dev/ai/package/roblox/post-ill/remote/files","readme":"# remote\n\n*remote* is a general purpose, minimal remote abstraction for Roblox.\n\n## Installation\n*remote* is available on [wally](https://wally.run/package/post-ill/remote), so on [pesde](https://docs.pesde.dev/guides/dependencies/#wally-dependencies).\nYou can also just go to the latest release, pick the [script](https://github.com/post-ill/remote/blob/master/src/init.luau) and drop it into your project.\n\n## Usage\n\n```luau\n-- shared\ndo\n  local remote = require(path.to.remote)\n\n  return remote.new({\n    name = \"attack/entity\",\n    param = function(data)\n      return type(data) == \"number\"\n    end\n  })\nend\n\n-- client/server\n\n-- as an event...\ndo\n  local event = require(path.to.your.event)\n  event:connect(function(...)\n    -- Use data here\n  end)\n  event:fire(...)\nend\n\n-- or as a function\ndo\n  local fn = require(path.to.your.fn)\n  fn:connect(function(...)\n    return yourData\n  end)\n  local ok, received = fn:invoke(...)\nend\n```\n\n## Schemas\n\n*remote* uses schemas to validate outgoing and incoming data, which are in the form of `(any) -> string?`. It's strongly\nrecomended to use [schema](https://github.com/post-ill/schema) for this case.\n\n## API\n\n| function              | description                                                                                                                |\n|-----------------------|----------------------------------------------------------------------------------------------------------------------------|\n| `remote.new(cfg)`     | creates a remote based on `cfg` config                                                                                     |\n| `remote:connect(fn)`  | binds `fn` callback to be executed on every remote `remote:fire`                                                           |\n| `remote:fire(...v)`   | calls remote connections made passing `...v` data                                                                          |\n| `remote:invoke(...v)` | calls remote handler passing `...v` data and yields until callee calls back. Returns the response sent by the counterparty |\n\n## Issues\n\nFeel free to open an [issue](https://github.com/post-ill/remote/issues/new) if you find out that the library\nis not behaving as expected.\n","readmeTruncated":false}