Search code examples
javascriptc++emscripten

javascript in C++


I'm working on a C++ project and need to utilize the functionality of a existing JavaScript library.

Essentially, I need a way to:

  1. Embed a JavaScript runtime within my C++ application.
  2. Load and execute the JavaScript library within this embedded runtime.
  3. Establish a mechanism for bidirectional communication between my C++ code and the JavaScript library's functions/objects.

Could you recommend specific libraries, techniques, or approaches for it (except emscripten - I can't use it for some reasons)?


Solution

  • Yes it is possible that you can run the javascript in your c++ code but you need a javascript engine like V8 Maybe this will help you a lot.