PythonJS is a multi-language Python translator. The translator is written in Python and runs inside NodeJS using a hacked and stripped down version of Empythoned. Empythoned is the standard C-Python interpreter compiled to JavaScript using Emscripten.

PythonJS can be used from the command line or as a library within your own NodeJS program. By default the translator will output JavaScript. You can also use the experimental backends for: Dart, Coffee, Lua and Vis.js. The Vis.js backend turns your code into a graph so you can inspect it visually in a web-browser using the vis.js library.

The PythonJS module exports an object named translator that contains functions to translate your python code using one of the backends.

When translating code for the Dart or Lua backends the required runtime header is inserted at the top of the output. Note that for the Javascript and Coffee backends, the runtime header is not included in the output - so if code is going to be run on the client side in a web browser, then you will need to manually include pythonjs.js script in the HTML page.