Skip to content

How to embed node.js? #818

Closed
Closed
@DiegoBM

Description

@DiegoBM

Node.js Version: Latest build
OS: All
Scope: Embed as shared library

Hi all,

Since this issue seems to always end up going unresolved, I'll bump it up to the top again due to the complexity of the topic.
I have been trying to embed node.dll into a simple C++ console project. In my particular case in Windows. All is ok with building the dll both in debug and release versions, but when the time comes to start embedding it, there is absolutely zero documentation in that regard, so I tried to follow Electron's source code which seems to have some extra libraries with initializers where I end up getting lost. In any case I cannot even get to the create environment step since I always have problems either creating the isolated data or creating the platform (V8's version not exposed on the dll), etc, so I must assume I'm doing one or many things wrong.

Could it be possible for someone in the node.js (or electron or node-chakracore) to please give us a brief tutorial/sample-project/something, that helps us all understand how to embed node.js into a C++ project, since it's a far-from-simple job?
Should we understand that the node.js team doesn't really want node.js to be embedded in other projects and hence the secrecy and/or absolute lack of documentation on how to embed it?

Thank you in advance if anyone can help. After a week trying it has started getting quite frustrating. Embedding ChakraCore on the other hand is stupidly simple, but of course you lose the whole environment node.js provides, which is a shame.

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions