wasm-python

1.0.3 • Public • Published

wasm-python

wasm-python wasm files to run python scripts in nodejs environments

USAGE:

// hello_python.js
const { loadPyodide } = require("pyodide");
const path = require("path");

async function hello_python() {
  let pyodide = await loadPyodide({
    // indexURL: "<pyodide artifacts folder>",
    indexURL: path.join("./node_modules/pyodide"),
  });

  // RUN YOUR PYTHON CODE
  return pyodide.runPythonAsync("1+1");
}

hello_python().then((result) => {
  console.log("Python says that 1+1 =", result);
});

Demos can be found here in the demos folder

This is a direct port of npm package to run python using pyodide ported for desktop-cgi

Check out more on different ways of using Python language interpretor inside of JS, Node.js here https://pythondev.readthedocs.io/wasm.html

PYODIDE

Package Sidebar

Install

npm i wasm-python

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

3.23 kB

Total Files

5

Last publish

Collaborators

  • ganeshkbhat