Skip to content

WIP V8 API usage in Node.js

I've had these notes around for a while, as a result of me spending some time trying to figure out how the V8 API works. Even in this rough draft form, I hope it might lower the barrier to entry for anybody wanting to work on node's C++.

I'll keep working on this as I have time, though I expect it to be slow. I'd be happy to have comments on inaccuracies or XXX in the text, and the "allow edits from maintainers" is ticked. V8 experts, please don't be shy to push fixups if you are so inclined!

V8's API is not very documented, so many (most?) of us just find existing code that does what we want to do and copy it, but https://github.com/nodejs/node/pull/26868 shows this can be problematic, because the expectations for how C++ should be written are evolving, and choosing the wrong existing code as a template can spread code practices that are now discouraged. Hopefully, this guide can point people to the current expectations.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading