Thanks for your views, I know it is very hard to build V8 and embed node.js and it never was my intention, I am talking about the light weight server node add-on which one would use like this.
Usage:
run the server
The vcmp server is provided as npm package everyone can download and use it just like a normal npm package, it does't contain v8 or node itself but the bindings and vcmp server implementation in c++, it also is ABI stable it will work on all version of node.js one does't have to worry about node or v8 version that is the main advantage of napi addons. napi addons are easy to use easy to maintain both c and c++ versions are available.
Very light-weight since the server is just a node add-on written in c/c++ and used via node javascript, no additional setup for user he just needs to install node I think almost everyone has it, there is no need to provide sqlite or other database driver they can use anything of their choice since he can use other thousands of modules in npm package repository. It might also work on web servers that have nodejs installed so servers might be hosted on web servers.
Here is an example of both c and c++ version of node add-on
Anyways since I just presented an idea and since there is no open source material to implement own version of vcmp server, I would not mind closing the thread.
Thanks for your informative replies.
Usage:
Code Select
npm install vcmp
Code Select
const vcmp = require('vcmp');
const npmModules = require('any npm module'); // user is free to use any npm module
vcmp.createServer(config => {
.........
});
// events
vcmp.onStart = () => {};
vcmp.onPlayerSpawn = () => {};
run the server
Code Select
node server.js
The vcmp server is provided as npm package everyone can download and use it just like a normal npm package, it does't contain v8 or node itself but the bindings and vcmp server implementation in c++, it also is ABI stable it will work on all version of node.js one does't have to worry about node or v8 version that is the main advantage of napi addons. napi addons are easy to use easy to maintain both c and c++ versions are available.
Very light-weight since the server is just a node add-on written in c/c++ and used via node javascript, no additional setup for user he just needs to install node I think almost everyone has it, there is no need to provide sqlite or other database driver they can use anything of their choice since he can use other thousands of modules in npm package repository. It might also work on web servers that have nodejs installed so servers might be hosted on web servers.
Here is an example of both c and c++ version of node add-on
Anyways since I just presented an idea and since there is no open source material to implement own version of vcmp server, I would not mind closing the thread.
Thanks for your informative replies.