Port Node N-API addon to V8 standalone

20 views
Skip to first unread message

Dominic Cerisano

unread,
Jan 21, 2020, 12:40:01 AM1/21/20
to v8-dev
Hi there,

I just built a N-API addon for Node, and now have a requirement to run it in a V8 standalone build (without Node).

From what I understand N-API is a wrapper around V8, so hoping a V8 standalone addon should be fairly straight-forward?

Are there examples of this? I have searched around not found anything specific about N-API addons for V8 standalone.



Ben Noordhuis

unread,
Jan 21, 2020, 3:48:12 AM1/21/20
to v8-...@googlegroups.com, Schulhof, Gabriel
Your answer is probably more appropriate for the v8-users mailing list
but to answer it: while the n-api _interface_ is runtime agnostic*,
its current _implementation_ is strongly tied to Node.js.

It's possible to create a standalone version that works with plain V8
but to my knowledge no one has done so, so far. I'm cc'ing Gabriel
Schulhof, n-api's maintainer, maybe he has more to say on the subject.
:-)

* Modulo some Node.js-specific APIs that you can stub/mock/leave out,
like napi_create_buffer() and napi_get_uv_event_loop().
Reply all
Reply to author
Forward
0 new messages