Passing jArchi out to Node using Inter-process communication

Started by 5-tom, May 13, 2024, 17:57:32 PM

Previous topic - Next topic

5-tom

I'm using a bit of a hack to get jArchi into an environment where I can use Node's builtins and ES modules, and was wondering if anyone has a better solution?

I'm piping the stdout of an .ajs script to a socket like so:

<run .ajs script here> | socat - /tmp/mysock.sock
My Node code:
import { Server } from "net";

const server = Server({});

server.on("connection", (client) => {
client.on("data", (data) => {
// use data here
}
});

server.listen("/tmp/mysock.sock");

Phil Beauvoir

Hi, jArchi does have some support for CommonJS modules, see:

https://github.com/archimatetool/archi-scripting-plugin/wiki/Using-Node.js-modules

But maybe you're trying to do something more complex?
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.