How to embed Node.js interpreter into C/C++?

后端 未结 6 1478
后悔当初
后悔当初 2020-12-05 22:43

I want to use Node.js scripts in my C/C++ applications. Some people suggested me to start with v8, libev and libeio; but it means rewriting Node.js from scratch.

So,

6条回答
  •  广开言路
    2020-12-05 23:19

    I was just checking out js-git which is made for Node.js and also depends on a few other Node.js modules.

    However, the same developer wrote a tool tim-task to wrap up some common Node.js functions, most importantly require, and to pack together some Node.js modules in such a way that it should not depend on Node.js anymore. He used it to make git-web-platform, i.e. js-git packed as a JS file which can be used in browsers. The resulted packed file looks like this. This can probably also be used with minor modifications just in pure V8.

    This might be useful for you. Note however that this approach will be limited.

提交回复
热议问题