0

Where is a clear, concise example of how to use Objective-C++ to access and use a native macOS framework in a Node.js native module?

For example: touch bar functionality

I would prefer for the example to be as short and simple as possible while still being clear. Thank you!

jocull
  • 20,008
  • 22
  • 105
  • 149

1 Answers1

0

One may write a node.js addon module in c++, but not Objective C.

If you have a c / c++ library api that allows you to play with the touch bar, you can write a node.js addon module in c++ that will expose this functionality to javascript.

I repeat node.js native addons can be written using c++, but not objective-C.

mkrufky
  • 3,268
  • 2
  • 17
  • 37
  • Can you call macOS frameworks from C++ directly without a bridge of some kind? – jocull Aug 29 '17 at 18:30
  • If you have a c / c++ library API to support the framework in question, then yes, you can. – mkrufky Aug 29 '17 at 18:36
  • Can you call Objective C from C++ and then call C++ from Node.js? I'm looking at [this answer on StackOverflow](https://stackoverflow.com/questions/1061005/calling-objective-c-method-from-c-member-function) – Chet Jan 16 '19 at 07:59
  • Sure, you can make a c++ native module that calls objective C, no problem – mkrufky Jan 16 '19 at 10:34