On Fri, Oct 5, 2012 at 11:02 AM, Graz <[email protected]> wrote: > Hi everybody. > > Is there any way to create shared library with nodeJS to link agains other > programs, written in (for example) C++? > > The reason why i need it is following: > i have some functions written in javascript and i'm looking for > availability to use these functions from other languages ( c++, python, perl > ) without rewriting them in plain C. > > So i'm looking for possibility of creating a library with these functions ( > i use mostly linux, so in my case this must be a shared library .so file).
It should be possible to build node as a shared library though I haven't tested that in recent times. Open the node.gyp file and change the type of the 'node' target from 'executable' to 'shared_library'. You will need to remove node_main.cc from the list of sources. Once compiled, node::Start() is your entry point. You will need additional plumbing if you want to call JS functions directly from your C++/Python/Perl code. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: 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 post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
