C++ and Node.js Integration - eBook Published
I’ve got good news, I’ve finally completed the C++ and Node.js Integration ebook! I want to thank all of you for signing up for my newsletter to keep posted about the book - you kept me motivated! Thanks also to all the people who reached out to me with ideas, tips, and insights into the topic - you were extremely helpful. You can buy the book on gumroad now, and there is a lot more information on the book’s webpage. For those of you that purchase the book, it would be great to hear feedback from you - either on this post or just email me!
The book is available in PDF, HTML, and epub. There’s over 200 pages of text, walking you through dozens of addons. You can also get full access to the code discussed in the text over at nodecpp-demo.
If you’d like a sample chapter, sign up for my Node.js Integration newsletter to keep up with posts to this blog.
Here’s a summary of the book contents - you can find more details here.
- Chapter 1 - Introduction to Node.js Addons: Learn the basics of creating Node.js Addons and how to use node-gyp to create and test them. We’ll go through a few quick examples, and outline the rest of the book.
- Chapter 2 - Understanding the V8 API: Learn about the C++ underpinnings of Node.js and how it all works. You’ll see why Node’s interface with C++ is so efficient, and how V8’s design effects how you write your addons. In this chapter we’ll cover all the V8 data types, and how the V8 memory system can be accessed from C++.
- Chapter 6 - Native Abstractions for Node (NAN): The V8 API has undergone many “breaking” changes - and since different version of Node.js use different versions of V8, the situation can get pretty complex to manage. This chapter will show you how to work at a higher level of abstraction using Nan - the Native Abstractions for Node.js library. Using Nan, you’ll defend yourself from the changing V8 API.
- Chapter 8 - Publishing Addons: Publishing your typical Node module to an npm repo is pretty simple - but since your C++ is native executable code, there are some hoops you’ll need to jump through so your addon works on all operating systems. In this chapter, we’ll cover solutions to common pitfalls involved in publishing/deploying C++ addons.
- Appendix A - Getting your C++ to the Web: Addons aren’t the only way of moving C++ to the web - in this section we’ll take a look at some of the other options, like automation and shared libraries.
You can get the book here - enjoy!