subprocess-loop

1.0.2 • Public • Published

subprocess-loop

This Node.js project facilitates communication with subprocesses, particularly programs written in Python or other languages, using standard input and output (stdio) in JSON format.

Installation

npm i subprocess-loop
pip install subprocess-loop

Running subprocess code:

import {SubprocessLoop} from "subprocess-loop";

let sumByPy = new SubprocessLoop("sumByPy", "python", "-u", "./child.py");
sumByPy.launch();
let result = await sumByPy.getResponse(100, 100);
sumByPy.terminate();
console.log(result);
# child.py
import subprocess_loop

def on_request(request):
    return request+1

subprocess_loop.Child.run(on_request)

Readme

Keywords

none

Package Sidebar

Install

npm i subprocess-loop

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

9.07 kB

Total Files

6

Last publish

Collaborators

  • dev-mx