What is the best practice to embed a NodeJS module in a Python project?

I am doing a small Python web project based on Django for which I need to use a module, which is written in JavaScript for NodeJS (Ulixee Hero). The NodeJS module would need to run server-side and be controlled by the Python-based implementation of the server app. Apparently, there once was a Python package to run JavaScript code (PyExecJs), which, however, is discontinued.

Given that I'm experienced with Python, but have only few experiences with JavaScript, and none with NPM or NodeJS, what is a good way to start? What is a good way to structure the Django project, given that there will be this NodeJS module? How to implement the interface between Python and the NodeJS module? I was hoping to find a guide, but it looks like this use case is rather exotic.

To what I have read so far, it looks like a good approach to run the NodeJS code using a subprocess. Are there better alternatives? What is the preferred way of installing NodeJS in this situation? My first goes was to use Pip, but the NodeJS version in pip is outdated and discontinued.

Back to Top