0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 07:00:59 +01:00
Commit Graph

75 Commits

Author SHA1 Message Date
Rich Trott
d1d412b413 doc: use sentence-case for headings in docs
PR-URL: https://github.com/nodejs/node/pull/33889
Refs: https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings
Refs: https://docs.microsoft.com/en-us/style-guide/capitalization
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-19 08:09:05 -07:00
Rich Trott
ac6739d96d doc: remove "currently" from addons.md
PR-URL: https://github.com/nodejs/node/pull/33756
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-07 12:36:37 -07:00
Derek Lewis
9dd7557c7d doc: normalize C++ code block info strings
Prior to this commit, C++ fenced code blocks in Markdown files had
inconsistent info strings. This has been corrected to standarize on
the one with the highest frequency in the doc/api/ dir.

Stats:
>  'cpp' => 19,
>  'C++' => 6,
>  'c++' => 3,

PR-URL: https://github.com/nodejs/node/pull/33483
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-23 17:21:20 +02:00
Gabriel Schulhof
e158218fb2 doc: update context-aware section of addon doc
Replace the portion of the context-aware addon example that advocates
for managing the life cycle of the per-addon-instance data using a
weak reference with code that illustrates how to manage its life cycle
using an environment cleanup hook.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: https://github.com/nodejs/node/pull/28659
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-03-31 10:22:12 -07:00
Rich Trott
36ce039347 doc: remove personal pronoun usage in addons.md
Per our style guide, avoid personal pronouns (I, you, we, etc.) in
reference documentation.

PR-URL: https://github.com/nodejs/node/pull/32142
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-03-09 19:47:24 -07:00
Rich Trott
b6cd2155c3 doc: remove em dashes
Our documentation uses em dashes inconsistently. They are treated
inconsistently typographically too. (For example, they are sometimes
surrounded by spaces and sometimes not.) They are also often confused
with ordinary hyphens such as in the CHANGELOG, where they are
inadvertently mixed together in a single list. The difference is
not obvious in the raw markdown but is very noticeable when rendered,
appearing to be a typographical error (which it in fact is).

The em dash is never needed. There are always alternatives. Remove em
dashes entirely.

PR-URL: https://github.com/nodejs/node/pull/32080
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-03-05 22:25:42 -08:00
Rich Trott
b3548d0c3b doc: reword section title in addons.md
Throughout the docs, we sometimes write the possessive of _Node.js_ as
_Node.js'_ and other times as _Node.js's_. The former conforms with some
generally accepted style guides (e.g., Associated Press Stylebook) while
the latter complies with others (e.g., Chicago Manual of Style).

Since there is no clear authoritative answer as to which form is
correct, and since (at least to me) both are visually jarring and
sometimes cause a pause to understand, I'd like to reword things to
eliminate the possessive form where possible.

This is one of those examples.

PR-URL: https://github.com/nodejs/node/pull/31713
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-02-12 00:20:34 -08:00
Rich Trott
d0f9585f52 doc: use code markup/markdown in headers in addons documentation
PR-URL: https://github.com/nodejs/node/pull/31086
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-12-26 21:36:59 -08:00
Anna Henningsen
62436c2fb3
doc: avoid using v8::Persistent in addon docs
Use `v8::Global` where possible. For examples where it applies,
also clean up the code and make the code multi-threading-ready,
for those where that isn’t easily possible, add a warning about that.

PR-URL: https://github.com/nodejs/node/pull/31018
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2019-12-24 14:31:29 +01:00
Rich Trott
db0154f16a doc: revise addons introduction for brevity and clarity
PR-URL: https://github.com/nodejs/node/pull/30756
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-12-03 22:47:18 -08:00
Anna Henningsen
5b2067c6ca
src: deprecate two- and one-argument AtExit()
Using `AtExit()` without an `Environment*` pointer or providing
an argument is almost always a sign of improperly relying on global
state and/or using `AtExit()` as an addon when the addon-targeting
`AddEnvironmentCleanupHook()` would be the better choice.

Deprecate those variants. This also updates the addon docs to
refer to `AddEnvironmentCleanupHook()` rather than `AtExit()`.

PR-URL: https://github.com/nodejs/node/pull/30227
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-11-05 23:59:02 +01:00
Anna Henningsen
a4123a86ef
src: make AtExit() callbacks run in reverse order
This makes the actual behaviour match the documented (and arguably
the correct) behaviour.

PR-URL: https://github.com/nodejs/node/pull/30230
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2019-11-05 20:37:27 +01:00
Rich Trott
72346bd8d4 doc: remove "it is important to" phrasing
Instead of telling someone "It is important to do X", just tell them to
"Do X."

PR-URL: https://github.com/nodejs/node/pull/30108
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-26 16:33:24 -07:00
Rich Trott
0ed22668bb doc: delete "a number of" things in the docs
Delete "a number of" phrases in the docs. See what I did there? Ha ha.
Ha ha. Ha. ...heh.. <clears throat/>

PR-URL: https://github.com/nodejs/node/pull/30103
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-26 11:25:43 -07:00
Rich Trott
10040500da doc: remove dashes
The use of dashes -- in general, but especially in our docs -- can be
problematic. It is used inconsistently and there is always another form
of punctuation that is as good or better for the situation. In an effort
to reduce the number of variations we use to display the same types of
information, remove the various uses of dashes from the documentation.

PR-URL: https://github.com/nodejs/node/pull/30101
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-26 08:39:41 -07:00
Nick Schonning
e2dcbf1c32 doc: use consistent unordered list style
Convert to asterisks when there are mixed styles in document.
Addresses Markdownlint MD004 rule

PR-URL: https://github.com/nodejs/node/pull/29516
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-09-16 11:24:54 -07:00
Nick Schonning
c929b15d1d doc: space around lists
Address markdownlint rule MD032.
Flagged a few mixed list styles.

PR-URL: https://github.com/nodejs/node/pull/29467
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-09-09 16:45:24 -07:00
Nick Schonning
27a57d3a34 doc: start unorded lists at start of line
Address Markdownlint MD006 rule.
Can flag when list items aren't indented far enough.

PR-URL: https://github.com/nodejs/node/pull/29390
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-09-03 20:55:39 -07:00
Michael Dawson
18405e66d2 doc: mention N-API as recommended approach
We've had a few comments that from the doc it might not
be clear that N-API is the recommended approach for Addons.
As a start, mention N-API early in the non N-API section
as the recommended approach unless lower level access
is required.

PR-URL: https://github.com/nodejs/node/pull/28922
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-08-16 14:47:27 -04:00
cjihrig
cce78bbdf5
doc: format try...catch consistently
PR-URL: https://github.com/nodejs/node/pull/28481
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-07-02 14:06:01 -04:00
cjihrig
a03f256409
doc: drop 'Note that' in addons docs
This commit removes the usage of 'Note that' in the addons
documentation. Note that this phrase was not adding anything
meaningful to the docs.

PR-URL: https://github.com/nodejs/node/pull/28327
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-06-22 13:36:06 -04:00
cjihrig
c6f959a9d0
doc: remove obsolete external link
The addons documentation links to an external node-qt repo as
a production example. That repo hasn't been updated in over
five years. This commit removes the link.

PR-URL: https://github.com/nodejs/node/pull/28326
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-06-22 13:33:09 -04:00
Geir Hauge
9a2025ca8a
doc: hello addon example should return "world"
The N-API version of the hello example, returned "hello" instead of
"world".

PR-URL: https://github.com/nodejs/node/pull/26328
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-03-05 23:54:31 +01:00
Anna Henningsen
8ebd339031
worker: improve integration with native addons
Allow loading add-ons from multiple Node.js instances if they are
declared context-aware; in particular, this applies to N-API addons.

Also, plug a memory leak that occurred when registering N-API addons.

Refs: https://github.com/nodejs/node/pull/23319

PR-URL: https://github.com/nodejs/node/pull/26175
Fixes: https://github.com/nodejs/node/issues/21481
Fixes: https://github.com/nodejs/node/issues/21783
Fixes: https://github.com/nodejs/node/issues/25662
Fixes: https://github.com/nodejs/node/issues/20239
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-22 21:42:09 +01:00
Vse Mozhet Byt
27a03b84c4 doc: make modules.md more accurate
PR-URL: https://github.com/nodejs/node/pull/25357
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-08 01:16:51 +02:00
Anna Henningsen
622e348d8f test,doc: add tests and docs for addon unloading
Originally from portions of https://github.com/nodejs/node/pull/23319/.

PR-URL: https://github.com/nodejs/node/pull/24861
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-12-19 18:34:28 -08:00
Daniel Bevenius
faa584ab22 test: fix v8 Set/Get compiler warnings
PR-URL: https://github.com/nodejs/node/pull/24246
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-11 08:02:30 +01:00
Daniel Bevenius
d58a0c6285 test: fix NewFromUtf8 compiler warning
Currently there are a number of compiler warnings like the following:

../binding.cc:6:41:
warning: 'NewFromUtf8' is deprecated:
Use maybe version [-Wdeprecated-declarations]
  args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
                                        ^
/node/deps/v8/include/v8.h:2883:10:
note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATE_SOON(
         ^
/node/deps/v8/include/v8config.h:341:29:
note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^

This commit updates the code to use the maybe versions.

PR-URL: https://github.com/nodejs/node/pull/24216
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-09 21:26:31 -08:00
Daniel Bevenius
59c7df4a10 test: fix compiler warning in doc/api/addons.md
Currently there are compiler warnings is emitted:
../addon.cc:17:58:
warning: 'ToString' is deprecated:
Use maybe version [-Wdeprecated-declarations]
obj->Set(String::NewFromUtf8(isolate, "msg"),
                             args[0]->ToString(isolate));
                                                         ^
deps/v8/include/v8.h:2537:3:
note: 'ToString' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version",
  ^

This commit updates examples to use the non-deprecated versions.

PR-URL: https://github.com/nodejs/node/pull/23323
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-10-11 05:18:11 +02:00
Andreas Haas
7dde560beb src: replace deprecated uses of FunctionTemplate::GetFunction
PR-URL: https://github.com/nodejs/node/pull/22993
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-24 05:44:28 +02:00
isurusiri
a1381fab8a doc: explain how to invoke gc
Currently the documentation for Wrapping C++ Objects doesn't explain
how to destruct an object by explicitly invoking the garbage collector.
This commit includes a modification to docs that explains how to force
the garbage collector to clear objects using V8's command line flags.

Fixes: https://github.com/nodejs/node/issues/19876

PR-URL: https://github.com/nodejs/node/pull/20431
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
2018-09-18 22:58:01 -07:00
Michaël Zasso
d9ea50ee66
doc: remove usage of deprecated V8 APIs in addons.md
PR-URL: https://github.com/nodejs/node/pull/22667
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-05 13:49:24 +02:00
Gabriel Schulhof
7033fc771a doc: add blurb about implications of ABI stability
Mention that ABI stability can be achieved only by linking to ABI-
stable parts of Node.js and to other libraries which are ABI-stable.

PR-URL: https://github.com/nodejs/node/pull/22508
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-09-03 11:32:29 -04:00
Gabriel Schulhof
602da6492f src: add context-aware init macro and doc
Introduces macros `NODE_MODULE_INITIALIZER` which expands to the name
of the special symbol that process.dlopen() will look for to initialize
an addon, and `NODE_MODULE_INIT()` which creates the boilerplate for
a context-aware module which can be loaded multiple times via the
special symbol mechanism.

Additionally, provides an example of using the new macro to construct
an addon which stores per-addon-instance data in a heap-allocated
structure that gets passed to each binding, rather than in a collection
of global static variables.

Re: https://github.com/nodejs/node/issues/21291#issuecomment-396729727
PR-URL: https://github.com/nodejs/node/pull/21318
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2018-07-03 18:34:50 -04:00
Tommaso Allevi
a8e5775195
doc: naming function as suggested in addon docs
PR-URL: https://github.com/nodejs/node/pull/21067
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-06-08 01:06:49 +02:00
Rich Trott
aa08cf1e7a doc: fix typo in addons.md
"across version of Node.js" -> "across versions of Node.js"

PR-URL: https://github.com/nodejs/node/pull/21137
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-05 19:02:14 -07:00
Michael Dawson
3706c65500 doc: fix stability text for n-api
While some places list n-api as stable, the reference
in doc/api/addons.md was missed.  This fixes that
instance.

Fixes: https://github.com/nodejs/node/issues/20645
PR-URL: https://github.com/nodejs/node/pull/20659
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-05-11 14:58:54 -07:00
Vse Mozhet Byt
7588ceaf35 doc: add more missing backticks
Also, fix some other nits in passing
(formatting, punctuation, typos, redundancy, obsoleteness).

PR-URL: https://github.com/nodejs/node/pull/20438
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-03 02:12:07 +03:00
Vse Mozhet Byt
a3bd06a5e6 doc: remove redundant empty lines
PR-URL: https://github.com/nodejs/node/pull/20398
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-04-29 17:48:43 +03:00
Vse Mozhet Byt
72dc1ae709 doc: add missing type=misc top comments
PR-URL: https://github.com/nodejs/node/pull/20022
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-14 14:54:55 +03:00
Vse Mozhet Byt
b3bff41690 doc, tools: make type parsing more strict
PR-URL: https://github.com/nodejs/node/pull/19881
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-11 14:11:29 +03:00
Vse Mozhet Byt
de0053cc32 doc: fix various nits
* Replace 2 hyphens (--) by spaced m-dashes (—) as per STYLE_GUIDE.md.
* Space infix operators.
* Unify quotes in inline code spans (use only single quotes).
* Unify `* Returns:` (eliminate deviations).
* Dedupe spaces.

PR-URL: https://github.com/nodejs/node/pull/19743
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-04 13:45:39 +03:00
Steven R. Loomis
7921e53ac5
doc: fix n-api example string
- using a length of 6 for `"hello"` includes a terminating null yielding
  `"hello\u0000"`
- length of 5 would work,
but comparing to the N-API docs gives `NAPI_AUTO_LENGTH` instead

PR-URL: https://github.com/nodejs/node/pull/19205
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-03-24 10:46:10 +01:00
Richard Lau
9e9c516512 doc: update list of re-exported symbols
libuv and zlib symbols are also purposefully re-exported by Node.js for
use in Addons.

Refs: https://github.com/nodejs/node/issues/17444

PR-URL: https://github.com/nodejs/node/pull/19013
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-02 10:38:37 -05:00
Rich Trott
9cb96ac828 doc: remove extraneous "for example" text
No need to announce obvious example code as being example code. Remove
unneeded "for example" text as one small way to try to keep the docs
more concise..

PR-URL: https://github.com/nodejs/node/pull/18890
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-02-23 02:53:21 +02:00
James M Snell
d3569b623c
doc: remove **Note:** tags
Remove the various **Note:** prefixes throughout the docs.

PR-URL: https://github.com/nodejs/node/pull/18592
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-02-08 11:57:14 -05:00
sreepurnajasti
c016cc2b17 doc: fix e.g., to e.g. in docs
PR-URL: https://github.com/nodejs/node/pull/18369
Fixes: https://github.com/nodejs/code-and-learn/issues/58
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-01-25 16:29:50 +02:00
Rod Vagg
57bd27eda8 Revert "build,test: make building addon tests less fragile"
This reverts commit d9b59def72.

Breaks downloadable source tarball builds as we remove some files prior
to creating a tarball but those files are included in the comprehensive
list of dependencies listed in .deps.

Ref: https://github.com/nodejs/node/pull/17407
PR-URL: https://github.com/nodejs/node/pull/18287
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-01-25 08:18:24 +11:00
Ben Noordhuis
d9b59def72
build,test: make building addon tests less fragile
* Get rid of recursive `make` when building the node binary.  An earlier
  commit makes GYP write out rules that we can use for proper dependency
  tracking.

* Use module name 'binding' in addons.md and addons-napi/*/binding.gyp.
  This massively simplifies the logic for generating the build rules.

* Check in auto-generated add-on tests from `doc/api/addons.md`.  The
  files change rarely and generating them dynamically causes no end of
  race conditions and special-casing during the build.

PR-URL: https://github.com/nodejs/node/pull/17407
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-01-21 02:19:46 +01:00
Franziska Hinkelmann
5279035d93
doc: add "Hello world" example for N-API
Our Addons documentation has a "Hello world" example that
outlines all steps to build it. Adding the sources for this
"Hello world" example for N-API.

PR-URL: https://github.com/nodejs/node/pull/17425
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-08 14:39:52 -05:00