Hello,

I've started doing a simple project, but I've hit a brick-wall on how to 
achieve certain "effects"

First things first. I have a Win32 application that embeds nodejs 
enviroment, for simplicity, let's say I have this simple code responsible 
for embedding node:

int main(int argc, char* argv[])
> {
> node::Start(argc, argv);
> return 0;
> }


When run, it works as expected.

Now, I wanted to add some addons for it. Let's say I have written a simple 
addon:

#include <nan.h>
> NAN_METHOD(hello)
> {
> info.GetReturnValue().Set(Nan::New("hello world!").ToLocalChecked());
> }
> NAN_MODULE_INIT(Init)
> {
> NAN_EXPORT(target, hello);
> }
> NODE_MODULE(addon, Init) 


If I compile it as external module and execute var addon = 
require('./addon.node') everything works great, but I want to have this 
already embedded when nodejs starts.

I know this is possible as nodejs itself does this, but I haven't yet 
figured out how to do this. Does anyone have an idea how do I combine the 
two c++ files into one binary that will work without the need to import the 
plugin?

With best regards,
Piotr

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/c037730f-b6ce-4d6a-8e43-42758b08b526%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to