diff --git a/doc/api/n-api.md b/doc/api/n-api.md index c146a6d661dddb..7ff884d93c8998 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -2492,6 +2492,33 @@ This API creates a JavaScript `symbol` value from a UTF8-encoded C string. The JavaScript `symbol` type is described in [Section 19.4][] of the ECMAScript Language Specification. +#### `napi_create_symbol_for` + + + +```c +napi_status napi_create_symbol_for(napi_env env, + napi_value description, + napi_value* result) +``` + +* `[in] env`: The environment that the API is invoked under. +* `[in] description`: Optional `napi_value` which refers to a JavaScript + `string` to be set as the description for the symbol. +* `[out] result`: A `napi_value` representing a JavaScript `symbol`. + +Returns `napi_ok` if the API succeeded. + +This API searches in the global registry for an existing symbol with the given +description. If the symbol already exists it will be returned, otherwise a new +symbol will be created in the registry. + +The JavaScript `symbol` type is described in [Section 19.4][] +of the ECMAScript Language Specification. + #### `napi_create_typedarray`