The easy as piss way to talk to Cumcord from your website.
For example:
// Find the port numbers of all available Cumcord instances.
const ports = (await cummunicate("get_info")).map(p => p[0]);
npm i @cumjar/cummunicate
import cummunicate from "@cumjar/cummunicate";
cummunicate()
<script type="module">
import cummunicate from "https://cdn.esm.sh/@cumjar/cummunicate";
cummunicate()
</script>
<script src="https://cdn.esm.sh/@cumjar/cummunicate/dist/browser.js"/>
<script>
cummunicate()
</script>
The cummunicate
function takes one or two args:
action: string
- The action to invoke on all available clientspayload?: object
- Any data to attach to the WS initiator message
It returns a promise of an array. Each array elem is a tuple of the following:
[0]: number
- The port of the client this reply is from[1]: WsReply
- The reply obtained from the client
Cummunicate will try to talk to any Cumcord instance that will connect.