Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf495a6

Browse filesBrowse files
mhdawsontargos
authored andcommitted
doc: clarify more optional parameters in node-api
Refs: nodejs/abi-stable-node#252 Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #40888 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 3d593aa commit cf495a6
Copy full SHA for cf495a6

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/n-api.md‎

Copy file name to clipboardExpand all lines: doc/api/n-api.md
+5-2Lines changed: 5 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,7 @@ napi_status napi_create_arraybuffer(napi_env env,
22162216
* `[in] env`: The environment that the API is invoked under.
22172217
* `[in] length`: The length in bytes of the array buffer to create.
22182218
* `[out] data`: Pointer to the underlying byte buffer of the `ArrayBuffer`.
2219+
`data` can optionally be ignored by passing `NULL`.
22192220
* `[out] result`: A `napi_value` representing a JavaScript `ArrayBuffer`.
22202221
22212222
Returns `napi_ok` if the API succeeded.
@@ -2250,6 +2251,7 @@ napi_status napi_create_buffer(napi_env env,
22502251
* `[in] env`: The environment that the API is invoked under.
22512252
* `[in] size`: Size in bytes of the underlying buffer.
22522253
* `[out] data`: Raw pointer to the underlying buffer.
2254+
`data` can optionally be ignored by passing `NULL`.
22532255
* `[out] result`: A `napi_value` representing a `node::Buffer`.
22542256
22552257
Returns `napi_ok` if the API succeeded.
@@ -2277,6 +2279,7 @@ napi_status napi_create_buffer_copy(napi_env env,
22772279
of the new buffer).
22782280
* `[in] data`: Raw pointer to the underlying buffer to copy from.
22792281
* `[out] result_data`: Pointer to the new `Buffer`'s underlying data buffer.
2282+
`result_data` can optionally be ignored by passing `NULL`.
22802283
* `[out] result`: A `napi_value` representing a `node::Buffer`.
22812284
22822285
Returns `napi_ok` if the API succeeded.
@@ -4588,8 +4591,8 @@ napi_status napi_create_function(napi_env env,
45884591
```
45894592
45904593
* `[in] env`: The environment that the API is invoked under.
4591-
* `[in] utf8Name`: The name of the function encoded as UTF8. This is visible
4592-
within JavaScript as the new function object's `name` property.
4594+
* `[in] utf8Name`: Optional name of the function encoded as UTF8. This is
4595+
visible within JavaScript as the new function object's `name` property.
45934596
* `[in] length`: The length of the `utf8name` in bytes, or `NAPI_AUTO_LENGTH` if
45944597
it is null-terminated.
45954598
* `[in] cb`: The native function which should be called when this function

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.