GithubHelp home page GithubHelp logo

Comments (3)

puria avatar puria commented on June 3, 2024 1

Hi @sguldemond, well that is by design, to allow the user to control the output and the stout behaviour. You can see for instance an example on

https://github.com/DECODEproject/zenroom/blob/eeb36395a7cc2e167771696c7c863dad46d9b3c7/docs/demo/shell_minimal.html#L156

hence on node environments you need some boilerplate, more on the emscripten documentation directly here: https://kripken.github.io/emscripten-site/docs/api_reference/module.html

So in your case should be enough to

var Module = {
  'print': text => console.log(text)
};

from zenroom.

sguldemond avatar sguldemond commented on June 3, 2024 1

Thanks @puria !

I added the following to 'zenroom_exec.js',
zenroom_module.print = text => console.log(text)
which gave me the output in my console.

Maybe it's an idea to add that to the source file of 'zenroom_exec.js' ?
That way anyone who wants to test it can just run it immediately like it says in the file:

// try this script from nodejs with a script as argument:
// nodejs zenroom_exec.js examples/hello.lua

from zenroom.

puria avatar puria commented on June 3, 2024

Thank you, please PR, @sguldemond

from zenroom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.