Skip to content

Commit 1e29086

Browse files
committed
specify nan vs addon
1 parent 0b07a5c commit 1e29086

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

node-cpp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Node.js C++ Addons
22

3-
The following document outlines Mapbox's approach to writing native abstractions for Node.js (anecdotally referred to as _addons_).
3+
The following document outlines Mapbox's approach to writing C++ modules for Node.js (often referred to as _addons_).
44

55
Node is integral to the Mapbox APIs. Sometimes at scale, though, Node becomes a bottleneck for performance. Node is single-threaded, which blocks execution. C++ on the other hand allows you to execute operations without clogging up the event loop. Passing heavy operations into C++ and subsequently into C++ workers can greatly improve the overall runtime of the code.
66

77
### Native Abstractions for Node.js (NAN)
88

9-
To swing between Node and C++, the Node community maintains a project called [_NAN_](https://github.com/nodejs/nan) (Native Abstractions for Node.js) that simplifies running different versions of Node and subsequently, V8. NAN is a header-only C++ library that provides a set of Macros for developing Node.js addons. Check out the [usage](https://github.com/nodejs/nan#usage) guidelines.
9+
To swing between Node and C++, the Node community maintains a project called [_NAN_](https://github.com/nodejs/nan) (Native Abstractions for Node.js) that simplifies running different versions of Node and, subsequently, V8. NAN is a header-only C++ library that provides a set of Macros for developing Node.js addons. Check out the [usage](https://github.com/nodejs/nan#usage) guidelines.
1010

11-
such as node-mapnik, node-osrm, and node-osmium. More examples of how to port C++ libraries to node can be found at nodejs.org/api/addons.html. See https://nodesource.com/blog/c-add-ons-for-nodejs-v4/ for a detailed summary of the origins of Nan.
11+
More examples of how to port C++ libraries to node can be found at [nodejs.org/api/addons](http://nodejs.org/api/addons.html). See https://nodesource.com/blog/c-add-ons-for-nodejs-v4/ for a detailed summary of the origins of Nan.
1212

1313
### Why create an addon?
1414

15-
Create an addon is a viable solution for the following reasons:
15+
An addon is a viable solution for the following reasons:
1616

1717
1. To port a C++ project to Node to expose a new interface for the tool (like Mapnik & Node Mapnik)
1818
1. Improve performance at scale where Node becomes the bottleneck.

0 commit comments

Comments
 (0)