1.21 gigawatts
1.21 gigawatts

Reputation: 17736

Can a C++ app or library be called from Node JS?

Can a C++ app or library be called from Node JS? I want to use this PSD parser, https://molecular-matters.com/index.html on a node js express js server. The PSD Parser looks like an app rather than a library.

I'm on OSX 10.15.7

Upvotes: 0

Views: 57

Answers (1)

lorro
lorro

Reputation: 10880

Yes, see inline-cpp for an easy-to-use interface:

const compile = require('inline-cpp');

const hello = compile `
  String func(const CallbackInfo& info) {
    return String::New(info.Env(), "Hello world from C++!");
  }
`

console.log(hello())

Downloads:

Upvotes: 1

Related Questions