Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] n-api: backport to v6.x #19447

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
146f554
n-api: add support for abi stable module API
jasongin Mar 20, 2017
7a43dd2
n-api: break dep between v8 and napi attributes
mhdawson Apr 3, 2017
6244224
napi: supress invalid coverity leak message
mhdawson Apr 3, 2017
69fe5ae
n-api: create napi_env as a real structure
Mar 28, 2017
8047b41
n-api: Update property attrs enum to match JS spec
jasongin Apr 5, 2017
7afb3bc
n-api: cache Symbol.hasInstance
Mar 31, 2017
1459aea
napi: initialize and check status properly
Apr 8, 2017
630b4bf
n-api: change napi_callback to return napi_value
boingoing Mar 24, 2017
257b28c
n-api: implement async helper methods
boingoing Mar 28, 2017
e6055bb
n-api: fix -Wmismatched-tags compiler warning
bnoordhuis Apr 11, 2017
3e6db1f
test: improve test coverage for n-api
mhdawson Apr 11, 2017
a5d892d
test: add second argument to assert.throws
targos Apr 7, 2017
d26cbed
test: fix compiler warning in n-api test
addaleax Apr 10, 2017
13261d9
n-api: add string api for latin1 encoding
Apr 12, 2017
89e816b
n-api: fix coverity scan report
mhdawson Apr 12, 2017
476b4ff
test: port test for make_callback to n-api
digitalinfinity Apr 14, 2017
4414e2b
Revert "test: port test for make_callback to n-api"
jasnell Apr 17, 2017
7a093c2
n-api: remove napi_get_value_string_length()
jasongin Apr 18, 2017
89e85e7
n-api: tighten null-checking and clean up last error
Apr 20, 2017
4653b67
n-api: Enable scope and ref APIs during exception
jasongin Apr 19, 2017
f7488e7
test: test doc'd napi_get_value_int32 behaviour
mhdawson Apr 24, 2017
1afabfc
test: add coverage for napi_cancel_async_work
mhdawson Apr 21, 2017
624a448
n-api: Reference and external tests
jasongin Apr 20, 2017
406f4ce
n-api: Sync with back-compat changes
jasongin Apr 26, 2017
9189c86
doc: Add initial documentation for N-API
mhdawson Apr 19, 2017
3461bc1
test: replace indexOf with includes
gwer Apr 22, 2017
b91ac10
test,lib,doc: use function declarations
Trott Apr 28, 2017
e89a911
n-api: remove unnecessary try-catch bracket from certain APIs
Apr 27, 2017
f14a0bb
test: fix warning in n-api reference test
mhdawson Apr 28, 2017
269e921
test: add coverage for error apis
mhdawson Apr 28, 2017
ed2ef69
test: port test for make_callback to n-api
digitalinfinity Apr 14, 2017
7491cee
test: fix napi test_reference for recent V8
targos May 5, 2017
61992ff
n-api: napi_get_cb_info should fill array
jasongin May 5, 2017
184ffb5
n-api: Handle fatal exception in async callback
jasongin May 4, 2017
b69818d
doc: fix broken links in n-api doc
mhdawson May 7, 2017
17d8b55
test: improve n-api array func coverage
mhdawson May 7, 2017
ce0e121
doc: clarify node.js addons are c++
BethGriggs May 8, 2017
bdd1375
test: add common.mustCall() to NAPI exception test
Trott May 11, 2017
ba2594e
doc: clarify operation of napi_cancel_async_work
mhdawson May 11, 2017
67e0372
test: improve N-API test coverage
mhdawson May 12, 2017
d572c9c
n-api: remove compiler warning
addaleax May 13, 2017
b10fe3e
test: Improve N-API test coverage
mhdawson May 16, 2017
726d584
n-api: Retain last code when getting error info
jasongin May 17, 2017
f7232ad
doc: add reference to node_api.h in docs
mhdawson May 17, 2017
2e48f58
doc: fix title/function name mismatch
mhdawson May 19, 2017
4d730be
test: increase n-api constructor coverage
mhdawson May 19, 2017
278ba33
src: correct endif comment SRC_NODE_API_H__
danbev May 24, 2017
54bd4b5
test: add coverage for napi_has_named_property
mhdawson May 23, 2017
5c0c021
n-api: add napi_get_version
mhdawson May 24, 2017
5c19e28
test: improve n-api coverage for typed arrays
mhdawson May 26, 2017
8653a1b
test: Make N-API weak-ref GC tests asynchronous
jasongin May 18, 2017
897bac2
doc: fix typo in n-api.md
disjukr May 31, 2017
2249581
n-api: enable napi_wrap() to work with any object
jasongin May 26, 2017
2052c6a
test: consolidate n-api test addons
mhdawson May 30, 2017
d572b0f
test: consolidate n-api test addons - part2
mhdawson Jun 1, 2017
28cf8f0
test: fix build warning in addons-napi/test_object
jasongin Jun 2, 2017
45be27f
doc: add ref to option to enable n-api
mhdawson Jun 2, 2017
8a96551
doc: fix typo "ndapi" in n-api.md
Jun 5, 2017
01302b1
doc: fix out of date sections in n-api doc
mhdawson Jun 6, 2017
02e7b63
test: add coverage for napi_property_descriptor
mhdawson Jun 6, 2017
2ff7692
doc: fix napi_create_*_error signatures in n-api
jamen Jun 8, 2017
2b94a31
doc: fix out of date napi_callback doc
XadillaX Jun 9, 2017
00ee027
doc: fix a few n-api doc issues
mhdawson Jun 13, 2017
f680c08
n-api: avoid crash in napi_escape_scope()
mhdawson Jun 13, 2017
512fc32
doc: doc lifetime of n-api last error info
mhdawson Jun 26, 2017
947b1cd
n-api: fix section title typo
kfarnung Jun 28, 2017
922ea46
test: verify napi_get_property() walks prototype
cjihrig Jun 28, 2017
ae0bdd5
n-api: add napi_delete_element()
cjihrig Jun 27, 2017
22b9a87
n-api: add napi_delete_property()
cjihrig Jun 26, 2017
c95b561
n-api: use Maybe version of Object::SetPrototype()
bnoordhuis Jul 3, 2017
c5c580c
n-api: fix -Wmaybe-uninitialized compiler warning
bnoordhuis Jul 3, 2017
134d7a1
test: add coverage for napi_typeof
mhdawson Jun 29, 2017
35b3c61
N-API: Reuse ObjectTemplate instances
Jun 30, 2017
bb5a56e
n-api: add napi_has_own_property()
cjihrig Jul 3, 2017
c8ae23e
n-api: fix warning in test_general
danbev Jul 6, 2017
99fc87e
n-api: Implement stricter wrapping
Jun 22, 2017
1536f37
n-api: wrap test macros in do/while
kfarnung Jul 5, 2017
fb572c4
test: handle missing V8 tests in n-api test
cjihrig Jul 7, 2017
5278223
n-api: add code parameter to error helpers
mhdawson Jun 29, 2017
25e46c5
n-api: add napi_fatal_error API
kfarnung Jun 28, 2017
bc83e71
test: replace string concat with template literal
4garfield Jul 16, 2017
e885661
doc: fix some links
vsemozhetbyt Jul 20, 2017
55e3ca8
n-api: add fast paths for integer getters
addaleax Jul 20, 2017
39ce757
n-api: directly create Local from Persistent
kfarnung Jul 13, 2017
8fab9bc
test: changed error message validator
pratik0509 Jul 24, 2017
b5ef731
n-api: re-use napi_env between modules
Jul 13, 2017
1fe2004
n-api: add support for DataView
shivanth Jul 19, 2017
fb41b01
doc: document napi_finalize() signature
cjihrig Jul 14, 2017
3be9e95
src: replace assert with CHECK_LE in node_api.cc
bnoordhuis Jul 27, 2017
2ae281e
n-api: optimize number API performance
jasongin Jul 19, 2017
11427ca
n-api: add napi_get_node_version
addaleax Aug 8, 2017
7ca8b1d
test: use regular expressions in throw assertions
vincentcn Jul 17, 2017
ca8eaa2
doc: delint
refack Aug 9, 2017
b0abcbf
doc: added napi_get_value_string_latin1
kfarnung Aug 7, 2017
f3a8d0a
n-api: add ability to remove a wrapping
Jul 27, 2017
41b7f4c
doc: fix doc for napi_get_value_string_utf8
Jul 28, 2017
6ec485a
test: remove unused parameters
human33 Aug 21, 2017
2bab64e
n-api: implement promise
Aug 24, 2017
28786e2
n-api: adds function to adjust external memory
Jun 28, 2017
32504e1
n-api: implement napi_run_script
Sep 6, 2017
63e8605
n-api: stop creating references to primitives
Sep 9, 2017
9c68371
n-api: use AsyncResource for Work tracking
addaleax Aug 8, 2017
14dc0f8
n-api: change async resource name to napi_value
jasongin Sep 9, 2017
ab1870a
n-api: refactor napi_addon_register_func
boingoing Aug 30, 2017
edfbc5b
n-api: Context for custom async operations
jasongin Aug 26, 2017
574f09e
n-api: napi_is_construct_call->napi_get_new_target
Aug 8, 2017
7fb617b
n-api: add optional string length parameters
Sep 11, 2017
a61dd4b
n-api: remove n-api module loading flag
Aug 18, 2017
ccc321d
doc: fix new nits in links
vsemozhetbyt Sep 17, 2017
3f8e900
n-api: fix warning about size_t compare with int
Sep 20, 2017
c683497
doc: fix outdated code sample in n-api.md
rebornix Sep 24, 2017
7e6c9f1
n-api: add check for large strings
mhdawson Sep 25, 2017
1b2c2a9
test: remove template literal
emilyford Oct 6, 2017
f589058
test: fix race condition in addon test
kkwoker Oct 6, 2017
b225e66
test: cleaned up assert messages
mrgorbo Oct 6, 2017
2e2b48b
n-api: make changes for source compatibility
Oct 9, 2017
45205f0
n-api,test: use module name macro
Oct 11, 2017
ae88690
test: remove redundant error messages
Oct 6, 2017
239859f
doc: fix some links
vsemozhetbyt Oct 14, 2017
6456daf
doc: update to use NAPI_AUTO_LENGTH
mhdawson Oct 13, 2017
a20e0d5
n-api: use module name macro
mhdawson Oct 13, 2017
96d1334
n-api: check against invalid handle scope usage
addaleax Oct 14, 2017
dd2a60e
n-api: unexpose symbols and remove EXTERNAL_NAPI
Oct 16, 2017
e2b58ab
test: improve message for assert.strictEqual()
Deep-Six Oct 6, 2017
6674c17
test: include actual value in assertion message
mattcan Oct 6, 2017
ec2c784
test: use default assertion messages
trootski Nov 6, 2017
4c8826f
test: add detailed message for assertion failure
pcdevil Nov 6, 2017
cc202a5
test: improve assert messages in napi exception test
PaulBlanche Nov 6, 2017
bfeeeb3
doc: fix a typo in n-api documentation
vipinmenon Nov 8, 2017
ab95aa4
test: improve error emssage reporting in testNapiRun.js
Nov 6, 2017
f3cfc2f
doc: fix typos in N-API
SwathiKalahastri Nov 10, 2017
c15b4ee
test: refactor addons-napi/test_promise/test.js
ka3e Nov 6, 2017
f450931
doc: document common pattern for instanceof checks
mhdawson Nov 2, 2017
d21b9a5
n-api: add helper for addons to get the event loop
addaleax Nov 17, 2017
c04169d
src: add napi_handle_scope_mismatch to msg list
Nov 20, 2017
32dd8f1
doc: use "JavaScript" instead of "Javascript"
Trott Nov 19, 2017
45a3e6b
n-api: use nullptr instead of NULL in node_api.cc
danbev Nov 23, 2017
d9dc130
doc: update example in module registration
fhinkel Dec 4, 2017
3f4ac09
test: replace assert.throws with common.expectsError
Leko Dec 4, 2017
a005c30
test: add unhandled rejection guard
babygoat Nov 23, 2017
2515f51
test: remove literals that obscure assert messages
Trott Dec 13, 2017
825468f
n-api: fix memory leak in napi_async_destroy()
Dec 17, 2017
6d5b622
test: remove ambiguous error messages from test_error
nadrane Dec 21, 2017
968d757
doc: updates examples to use NULL
mhdawson Jan 5, 2018
2f92a07
n-api: throw RangeError in napi_create_dataview() with invalid range
romandev Dec 26, 2017
9dc08ae
n-api: expose n-api version in process.versions
mhdawson Jan 9, 2018
edb244f
doc: napi: fix unbalanced emphasis
ofrobots Jan 12, 2018
85b964b
doc: napi: make header style consistent
ofrobots Jan 12, 2018
5d06fab
n-api: throw RangeError napi_create_typedarray()
romandev Jan 8, 2018
e32cca2
test: fixed typos in napi test
furstenheim Jan 14, 2018
91c9e19
doc: remove uannecessary Require
mhdawson Jan 16, 2018
f103e21
test: refactor addons-napi/test_exception/test.js
Trott Jan 24, 2018
0fd8ceb
n-api: change assert ok check to notStrictEqual.
nbdaaron Jan 27, 2018
e57f34c
test: show pending exception error in napi tests
reccanti Jan 27, 2018
5c183d7
n-api: implement wrapping using private properties
Jan 23, 2018
76dfefa
n-api: wrap control flow macro in do/while
bnoordhuis Feb 2, 2018
b7093fa
doc: remove usage of you in n-api doc
mhdawson Feb 2, 2018
ed7e64b
doc: small typo in n-api.md
iSkore Feb 4, 2018
63d1f02
n-api: add methods to open/close callback scope
mhdawson Dec 13, 2017
d75fbeb
n-api: remove extra reference from test
Feb 3, 2018
4753369
doc: fix typo in n-api.md
vsemozhetbyt Feb 6, 2018
c7f4a4f
test: improve error message output
bshankar Feb 1, 2018
85728d1
test: convert new tests to use error types
jackhorton Feb 5, 2018
4950772
doc: fix exporting a function example
Feb 8, 2018
7996463
doc: mark NAPI_AUTO_LENGTH as code
tniessen Feb 10, 2018
a12f442
test: remove unnecessary timer
cjihrig Feb 11, 2018
8786335
n-api: fix object test
Feb 27, 2018
0efd826
doc: fix n-api asynchronous threading docs
ebickle Mar 1, 2018
cab6ce9
n-api: update reference test
Mar 2, 2018
ab4763d
n-api: update documentation
Mar 1, 2018
a5ec82f
n-api: resolve promise in test
Mar 8, 2018
b0e458a
n-api,test: add a new.target test to addons-napi
boingoing Jan 17, 2018
f07b614
n-api: take n-api out of experimental
mhdawson Apr 10, 2018
fdd3f57
n-api,test: add int64 bounds tests
kfarnung Mar 12, 2018
7c784de
doc: fix typos on n-api
shama Mar 16, 2018
dd61f8e
n-api: add missing exception checking
mhdawson Mar 15, 2018
78ccedf
n-api: add napi_fatal_exception
mafintosh Mar 14, 2018
6b12016
n-api: re-write test_make_callback
Mar 19, 2018
041c9a0
doc: Add a missing comma
leaves4j Mar 23, 2018
96fe46b
n-api: bump version of n-api supported
mhdawson Mar 20, 2018
f4b0f7a
n-api: ensure in-module exceptions are propagated
Mar 22, 2018
dc4c825
n-api: back up env before finalize
Apr 1, 2018
f498a62
n-api: add more `int64_t` tests
kfarnung Mar 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 52 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ v8:

test: all
$(MAKE) build-addons
$(MAKE) build-addons-napi
$(MAKE) cctest
$(PYTHON) tools/test.py --mode=release -J \
doctool inspector known_issues message pseudo-tty parallel sequential addons
doctool inspector known_issues message pseudo-tty parallel sequential addons addons-napi
$(MAKE) lint

test-parallel: all
Expand Down Expand Up @@ -189,6 +190,41 @@ test/addons/.buildstamp: config.gypi \
# TODO(bnoordhuis) Force rebuild after gyp update.
build-addons: $(NODE_EXE) test/addons/.buildstamp

ADDONS_NAPI_BINDING_GYPS := \
$(filter-out test/addons-napi/??_*/binding.gyp, \
$(wildcard test/addons-napi/*/binding.gyp))

ADDONS_NAPI_BINDING_SOURCES := \
$(filter-out test/addons-napi/??_*/*.cc, $(wildcard test/addons-napi/*/*.cc)) \
$(filter-out test/addons-napi/??_*/*.h, $(wildcard test/addons-napi/*/*.h))

# Implicitly depends on $(NODE_EXE), see the build-addons-napi rule for rationale.
test/addons-napi/.buildstamp: config.gypi \
deps/npm/node_modules/node-gyp/package.json \
$(ADDONS_NAPI_BINDING_GYPS) $(ADDONS_NAPI_BINDING_SOURCES) \
deps/uv/include/*.h deps/v8/include/*.h \
src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \
src/node_api.h src/node_api_types.h
# Cannot use $(wildcard test/addons-napi/*/) here, it's evaluated before
# embedded addons have been generated from the documentation.
@for dirname in test/addons-napi/*/; do \
printf "\nBuilding addon $$PWD/$$dirname\n" ; \
env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \
--loglevel=$(LOGLEVEL) rebuild \
--python="$(PYTHON)" \
--directory="$$PWD/$$dirname" \
--nodedir="$$PWD" || exit 1 ; \
done
touch $@

# .buildstamp and .docbuildstamp need $(NODE_EXE) but cannot depend on it
# directly because it calls make recursively. The parent make cannot know
# if the subprocess touched anything so it pessimistically assumes that
# .buildstamp and .docbuildstamp are out of date and need a rebuild.
# Just goes to show that recursive make really is harmful...
# TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
build-addons-napi: $(NODE_EXE) test/addons-napi/.buildstamp

clear-stalled:
# Clean up any leftover processes but don't error if found.
ps awwx | grep Release/node | grep -v grep | cat
Expand All @@ -200,20 +236,22 @@ clear-stalled:
test-gc: all test/gc/node_modules/weak/build/Release/weakref.node
$(PYTHON) tools/test.py --mode=release gc

test-build: | all build-addons
test-build: | all build-addons build-addons-napi

test-build-addons-napi: all build-addons-napi

test-all: test-build test/gc/node_modules/weak/build/Release/weakref.node
$(PYTHON) tools/test.py --mode=debug,release

test-all-valgrind: test-build
$(PYTHON) tools/test.py --mode=debug,release --valgrind

CI_NATIVE_SUITES := addons
CI_NATIVE_SUITES := addons addons-napi
CI_JS_SUITES := doctool inspector known_issues message parallel pseudo-tty sequential

# Build and test addons without building anything else
test-ci-native: LOGLEVEL := info
test-ci-native: | test/addons/.buildstamp
test-ci-native: | test/addons/.buildstamp test/addons-napi/.buildstamp
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=release --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) $(CI_NATIVE_SUITES)
Expand All @@ -231,11 +269,11 @@ test-ci-js: | clear-stalled
fi

test-ci: LOGLEVEL := info
test-ci: | clear-stalled build-addons
test-ci: | clear-stalled build-addons build-addons-napi
out/Release/cctest --gtest_output=tap:cctest.tap
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=release --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES)
$(TEST_CI_ARGS) $(CI_JS_SUITES) addons-napi $(CI_NATIVE_SUITES)
# Clean up any leftover processes, error if found.
ps awwx | grep Release/node | grep -v grep | cat
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
Expand Down Expand Up @@ -282,7 +320,10 @@ test-npm: $(NODE_EXE)
test-npm-publish: $(NODE_EXE)
npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js

test-addons: test-build
test-addons-napi: test-build-addons-napi
$(PYTHON) tools/test.py --mode=release addons-napi

test-addons: test-build test-addons-napi
$(PYTHON) tools/test.py --mode=release addons

test-addons-clean:
Expand Down Expand Up @@ -813,6 +854,8 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
test/addons/*/*.h \
test/cctest/*.cc \
test/cctest/*.h \
test/addons-napi/*/*.cc \
test/addons-napi/*/*.h \
tools/icu/*.cc \
tools/icu/*.h \
))
Expand Down Expand Up @@ -857,5 +900,6 @@ endif
bench-buffer bench-net bench-http bench-fs bench-tls cctest run-ci \
test-v8 test-v8-intl test-v8-benchmarks test-v8-all v8 lint-ci \
bench-ci lint-js-ci doc-only $(TARBALL)-headers test-ci test-ci-native \
test-ci-js build-ci test-hash-seed clear-stalled
test-ci-js build-ci test-hash-seed clear-stalled test-addons-napi \
build-addons-napi

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ us a report nonetheless.

- [#14519](https://github.com/nodejs/node/issues/14519): _Internal domain
function can be used to cause segfaults_. Causing program termination using
either the public Javascript APIs or the private bindings layer APIs requires
the ability to execute arbitrary Javascript code, which is already the highest
either the public JavaScript APIs or the private bindings layer APIs requires
the ability to execute arbitrary JavaScript code, which is already the highest
level of privilege possible.

- [#12141](https://github.com/nodejs/node/pull/12141): _buffer: zero fill
Expand Down
3 changes: 2 additions & 1 deletion doc/api/_toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

* [Assertion Testing](assert.html)
* [Buffer](buffer.html)
* [C/C++ Addons](addons.html)
* [C++ Addons](addons.html)
* [C/C++ Addons - N-API](n-api.html)
* [Child Processes](child_process.html)
* [Cluster](cluster.html)
* [Command Line Options](cli.html)
Expand Down
26 changes: 23 additions & 3 deletions doc/api/addons.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# C/C++ Addons
# C++ Addons

<!--introduced_in=v0.10.0-->

Node.js Addons are dynamically-linked shared objects, written in C or C++, that
Node.js Addons are dynamically-linked shared objects, written in C++, that
can be loaded into Node.js using the [`require()`][require] function, and used
just as if they were an ordinary Node.js module. They are used primarily to
provide an interface between JavaScript running in Node.js and C/C++ libraries.
Expand All @@ -28,7 +28,7 @@ involving knowledge of several components and APIs :
off-loading work via libuv to non-blocking system operations, worker threads
or a custom use of libuv's threads.

- Internal Node.js libraries. Node.js itself exports a number of C/C++ APIs
- Internal Node.js libraries. Node.js itself exports a number of C++ APIs
that Addons can use &mdash; the most important of which is the
`node::ObjectWrap` class.

Expand Down Expand Up @@ -215,6 +215,26 @@ Addon developers are recommended to use to keep compatibility between past and
future releases of V8 and Node.js. See the `nan` [examples][] for an
illustration of how it can be used.


## N-API

> Stability: 1 - Experimental
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


N-API is an API for building native Addons. It is independent from
the underlying JavaScript runtime (ex V8) and is maintained as part of
Node.js itself. This API will be Application Binary Interface (ABI) stable
across version of Node.js. It is intended to insulate Addons from
changes in the underlying JavaScript engine and allow modules
compiled for one version to run on later versions of Node.js without
recompilation. Addons are built/packaged with the same approach/tools
outlined in this document (node-gyp, etc.). The only difference is the
set of APIs that are used by the native code. Instead of using the V8
or [Native Abstractions for Node.js][] APIs, the functions available
in the N-API are used.

The functions available and how to use them are documented in the
section titled [C/C++ Addons - N-API](n-api.html).

## Addon examples

Following are some example Addons intended to help developers get started. The
Expand Down
1 change: 0 additions & 1 deletion doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ Node options that are allowed are:
- `--debug-brk`
- `--debug-port`
- `--debug`
- `--napi-modules`
- `--no-deprecation`
- `--no-warnings`
- `--openssl-config`
Expand Down
4 changes: 2 additions & 2 deletions doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ added: v0.1.27
- `rrtype` {string} Resource record type. Default: `'A'`.
- `callback` {Function}
- `err` {Error}
- `records` {string[] | Object[] | string[][] | Object}
- `records` {string[] | Object[] | Object}

Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an array
of the resource records. The `callback` function has arguments
Expand Down Expand Up @@ -362,7 +362,7 @@ added: v0.1.27
- `hostname` {string}
- `callback` {Function}
- `err` {Error}
- `records` {string[][]}
- `records` {string[]}

Uses the DNS protocol to resolve text queries (`TXT` records) for the
`hostname`. The `records` argument passed to the `callback` function is a
Expand Down
Loading