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

doc: clarify more optional parameters in node-api #40888

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,7 @@ napi_status napi_create_arraybuffer(napi_env env,
* `[in] env`: The environment that the API is invoked under.
* `[in] length`: The length in bytes of the array buffer to create.
* `[out] data`: Pointer to the underlying byte buffer of the `ArrayBuffer`.
`data` can optionally be ignored by passing `NULL`.
* `[out] result`: A `napi_value` representing a JavaScript `ArrayBuffer`.

Returns `napi_ok` if the API succeeded.
Expand Down Expand Up @@ -2250,6 +2251,7 @@ napi_status napi_create_buffer(napi_env env,
* `[in] env`: The environment that the API is invoked under.
* `[in] size`: Size in bytes of the underlying buffer.
* `[out] data`: Raw pointer to the underlying buffer.
`data` can optionally be ignored by passing `NULL`.
* `[out] result`: A `napi_value` representing a `node::Buffer`.

Returns `napi_ok` if the API succeeded.
Expand Down Expand Up @@ -2277,6 +2279,7 @@ napi_status napi_create_buffer_copy(napi_env env,
of the new buffer).
* `[in] data`: Raw pointer to the underlying buffer to copy from.
* `[out] result_data`: Pointer to the new `Buffer`'s underlying data buffer.
`result_data` can optionally be ignored by passing `NULL`.
* `[out] result`: A `napi_value` representing a `node::Buffer`.

Returns `napi_ok` if the API succeeded.
Expand Down Expand Up @@ -4588,8 +4591,8 @@ napi_status napi_create_function(napi_env env,
```

* `[in] env`: The environment that the API is invoked under.
* `[in] utf8Name`: The name of the function encoded as UTF8. This is visible
within JavaScript as the new function object's `name` property.
* `[in] utf8Name`: Optional name of the function encoded as UTF8. This is
visible within JavaScript as the new function object's `name` property.
* `[in] length`: The length of the `utf8name` in bytes, or `NAPI_AUTO_LENGTH` if
it is null-terminated.
* `[in] cb`: The native function which should be called when this function
Expand Down