1.0.1 • Published 3 years ago

@erez213/sagecell-node-client v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

sagecell-node-client

Overview

This is node module to integrate to SageCell server via JS.

Example

var client = new sagecell({
    onstatuschange: (status) => {
        console.log("status change", status);
        if (status == "connected") {
            client.sendCommand(null, "plot(x,x)");
        }
    },
    onmessage: (msg) => {
        console.log("msg", msg);
    },
    onerror: (from, err) => {
        console.log("err", from, err);
    },
    timeout: 30
});
client.connect();

Listening to responses can also be done using promises:

client.sendCommand(null, "plot(x,x)").then((res) => {
    console.log("on message", res);
}).catch((err) => {
    console.log("on err", err);
});

References

Sagecell: https://sagecell.sagemath.org/

1.0.1

3 years ago

1.0.0

3 years ago