From c51ca10359e4c2ae5b8ee6c9328a7ce951741136 Mon Sep 17 00:00:00 2001 From: h7lin Date: Fri, 1 May 2020 20:36:30 +0800 Subject: [PATCH] feat: 14.1.0 --- ...sert_doesnotmatch_string_regexp_message.md | 4 +- assert/assert_match_string_regexp_message.md | 4 +- assert/strict_assertion_mode.md | 4 +- buffer/buf_readbigint64le_offset.md | 4 +- buffer/buf_readbiguint64le_offset.md | 4 +- buffer/buf_writebigint64le_value_offset.md | 4 +- buffer/buf_writebiguint64le_value_offset.md | 4 +- child_process/advanced_serialization.md | 4 +- ...ld_process_fork_modulepath_args_options.md | 4 +- ...hild_process_spawn_command_args_options.md | 4 +- cli/experimental_import_meta_resolve.md | 4 +- cli/experimental_specifier_resolution_mode.md | 4 +- cli/experimental_wasi_unstable_preview1.md | 4 +- cli/insecure_http_parser.md | 5 +- cli/max_http_header_size_size.md | 4 +- cli/node_repl_external_module_file.md | 4 +- cli/tls_keylog_file.md | 4 +- cli/tls_max_v1_2.md | 4 +- cli/tls_min_v1_0.md | 4 +- cli/tls_min_v1_1.md | 4 +- cli/tls_min_v1_2.md | 4 +- cli/trace_exit.md | 4 +- cli/unhandled_rejections_mode.md | 4 +- cluster/cluster_settings.md | 4 +- ...createcipheriv_algorithm_key_iv_options.md | 4 +- ...eatedecipheriv_algorithm_key_iv_options.md | 4 +- ...t_password_salt_keylen_options_callback.md | 4 +- ...scryptsync_password_salt_keylen_options.md | 4 +- .../dep0121_net_setsimultaneousaccepts.md | 2 +- deprecations/dep0136_http_finished.md | 4 +- ...dep0139_process_umask_with_no_arguments.md | 119 +--------------- ...equest_destroy_instead_of_request_abort.md | 131 ++++++++++++++++++ ...address_groupaddress_multicastinterface.md | 4 +- ...address_groupaddress_multicastinterface.md | 4 +- errors/err_internal_assertion.md | 2 +- errors/err_socket_cannot_send.md | 2 +- errors/hpe_header_overflow.md | 4 +- esm/resolver_algorithm.md | 4 +- events/class_eventemitter.md | 4 +- ...for_nodejs_rejection_err_eventname_args.md | 4 +- events/eventemitter_errormonitor.md | 4 +- events/events_capturerejections.md | 4 +- events/events_capturerejectionsymbol.md | 4 +- events/events_on_emitter_eventname.md | 4 +- events/events_once_emitter_name.md | 4 +- fs/class_fs_dirent.md | 5 +- fs/fs_mkdir_path_options_callback.md | 4 +- fs/fs_mkdirsync_path_options.md | 2 +- fs/fs_mkdtemp_prefix_options_callback.md | 14 +- fs/fs_opendir_path_options_callback.md | 6 +- fs/fs_opendirsync_path_options.md | 6 +- fs/fs_rmdir_path_options_callback.md | 4 +- fs/fs_rmdirsync_path_options.md | 4 +- fs/fs_stat_path_options_callback.md | 2 +- fs/fspromises_mkdir_path_options.md | 4 +- fs/fspromises_opendir_path_options.md | 6 +- fs/fspromises_rmdir_path_options.md | 4 +- fs/readstream_pending.md | 4 +- http/class_http_incomingmessage.md | 4 +- ...tp_createserver_options_requestlistener.md | 5 +- http/http_maxheadersize.md | 4 +- http/http_request_url_options_callback.md | 58 ++++++-- http/request_abort.md | 1 + http/request_destroy_error.md | 13 ++ http/request_destroyed.md | 10 ++ http/request_finished.md | 4 +- http/request_reusedsocket.md | 5 +- http/response_cork.md | 4 +- http/response_finished.md | 4 +- http/response_uncork.md | 4 +- ...tehead_statuscode_statusmessage_headers.md | 4 +- http/server_headerstimeout.md | 4 +- ...tesecureserver_options_onrequesthandler.md | 8 +- ...2_createserver_options_onrequesthandler.md | 8 +- http2/http2stream_buffersize.md | 4 +- http2/response_finished.md | 4 +- ...tehead_statuscode_statusmessage_headers.md | 4 +- https/event_keylog.md | 4 +- https/https_request_url_options_callback.md | 5 +- modules/source_map_v3_support.md | 2 +- ...asynchronous_thread_safe_function_calls.md | 13 ++ n-api/n_api_version_matrix.md | 19 +-- n-api/napi_call_threadsafe_function.md | 14 +- n-api/napi_create_date.md | 4 +- n-api/napi_create_threadsafe_function.md | 4 +- n-api/napi_detach_arraybuffer.md | 4 +- n-api/napi_get_all_property_names.md | 4 +- n-api/napi_get_date_value.md | 4 +- n-api/napi_get_instance_data.md | 4 +- n-api/napi_is_date.md | 4 +- n-api/napi_is_detached_arraybuffer.md | 4 +- n-api/napi_key_collection_mode.md | 4 +- n-api/napi_key_conversion.md | 4 +- n-api/napi_key_filter.md | 4 +- n-api/napi_set_instance_data.md | 4 +- n-api/napi_status.md | 1 + net/socket_pending.md | 4 +- os/os_release.md | 2 +- os/os_type.md | 2 +- os/os_version.md | 2 +- process/event_uncaughtexception.md | 4 +- readline/rl_getcursorpos.md | 4 +- readline/rl_symbol_asynciterator.md | 8 +- report/interaction_with_workers.md | 4 +- ...constructor_new_stream_writable_options.md | 16 ++- stream/new_stream_readable_options.md | 4 +- ...stream_finished_stream_options_callback.md | 15 ++ ..._source_transforms_destination_callback.md | 6 + stream/writable_writablecorked.md | 4 +- tls/event_keylog.md | 4 +- tls/event_keylog_1.md | 4 +- tls/tls_connect_options_callback.md | 15 +- tls/tls_createsecurecontext_options.md | 4 +- tls/tlssocket_getcipher.md | 8 +- tty/writestream_hascolors_count_env.md | 4 +- url/constructor_new_url_input_base.md | 7 + ..._inspect_object_showhidden_depth_colors.md | 4 +- util/util_promisify_custom.md | 4 +- vm/class_vm_module.md | 4 +- vm/class_vm_syntheticmodule.md | 4 +- vm/constructor_new_vm_script_code_options.md | 2 +- ...le_exportnames_evaluatecallback_options.md | 4 +- vm/syntheticmodule_setexport_name_value.md | 4 +- vm/vm_compilefunction_code_params_options.md | 14 ++ wasi/class_wasi.md | 4 +- wasi/new_wasi_options.md | 4 +- wasi/wasi_start_instance.md | 4 +- wasi/wasi_wasiimport.md | 4 +- wasi/webassembly_system_interface_wasi.md | 2 +- worker_threads/new_worker_filename_options.md | 12 +- worker_threads/worker_resourcelimits.md | 4 +- worker_threads/worker_resourcelimits_1.md | 4 +- worker_threads/worker_unref.md | 1 + zlib/brotli_constants.md | 4 +- zlib/class_zlib_brotlicompress.md | 4 +- zlib/class_zlib_brotlidecompress.md | 4 +- zlib/class_zlib_zlibbase.md | 4 +- ...compressing_http_requests_and_responses.md | 2 +- ..._brotlicompress_buffer_options_callback.md | 4 +- .../zlib_brotlicompresssync_buffer_options.md | 4 +- ...rotlidecompress_buffer_options_callback.md | 4 +- ...lib_brotlidecompresssync_buffer_options.md | 4 +- zlib/zlib_createbrotlicompress_options.md | 4 +- zlib/zlib_createbrotlidecompress_options.md | 4 +- 144 files changed, 688 insertions(+), 294 deletions(-) create mode 100644 deprecations/dep0140_use_request_destroy_instead_of_request_abort.md create mode 100644 http/request_destroy_error.md create mode 100644 http/request_destroyed.md diff --git a/assert/assert_doesnotmatch_string_regexp_message.md b/assert/assert_doesnotmatch_string_regexp_message.md index 4acf205a..cf47040a 100644 --- a/assert/assert_doesnotmatch_string_regexp_message.md +++ b/assert/assert_doesnotmatch_string_regexp_message.md @@ -1,5 +1,7 @@ * `string` {string} diff --git a/assert/assert_match_string_regexp_message.md b/assert/assert_match_string_regexp_message.md index 328ede3c..ffbcfd91 100644 --- a/assert/assert_match_string_regexp_message.md +++ b/assert/assert_match_string_regexp_message.md @@ -1,5 +1,7 @@ * `string` {string} diff --git a/assert/strict_assertion_mode.md b/assert/strict_assertion_mode.md index f5511829..cac9f657 100644 --- a/assert/strict_assertion_mode.md +++ b/assert/strict_assertion_mode.md @@ -1,7 +1,9 @@ * `offset` {integer} 开始读取之前要跳过的字节数。必须满足:`0 <= offset <= buf.length - 8`。**默认值:** `0`。 diff --git a/buffer/buf_readbiguint64le_offset.md b/buffer/buf_readbiguint64le_offset.md index 6a4d09f3..cf80224e 100644 --- a/buffer/buf_readbiguint64le_offset.md +++ b/buffer/buf_readbiguint64le_offset.md @@ -1,5 +1,7 @@ * `offset` {integer} 开始读取之前要跳过的字节数。必须满足:`0 <= offset <= buf.length - 8`。**默认值:** `0`。 diff --git a/buffer/buf_writebigint64le_value_offset.md b/buffer/buf_writebigint64le_value_offset.md index e01db3b0..0e9fe74d 100644 --- a/buffer/buf_writebigint64le_value_offset.md +++ b/buffer/buf_writebigint64le_value_offset.md @@ -1,5 +1,7 @@ * `value` {bigint} 要写入 `buf` 的数值。 diff --git a/buffer/buf_writebiguint64le_value_offset.md b/buffer/buf_writebiguint64le_value_offset.md index 4d257eca..14ce6362 100644 --- a/buffer/buf_writebiguint64le_value_offset.md +++ b/buffer/buf_writebiguint64le_value_offset.md @@ -1,5 +1,7 @@ * `value` {bigint} 要写入 `buf` 的数值。 diff --git a/child_process/advanced_serialization.md b/child_process/advanced_serialization.md index 24699d35..6f390deb 100644 --- a/child_process/advanced_serialization.md +++ b/child_process/advanced_serialization.md @@ -1,5 +1,7 @@ Child processes support a serialization mechanism for IPC that is based on the diff --git a/child_process/child_process_fork_modulepath_args_options.md b/child_process/child_process_fork_modulepath_args_options.md index f0c4465f..571a7b58 100644 --- a/child_process/child_process_fork_modulepath_args_options.md +++ b/child_process/child_process_fork_modulepath_args_options.md @@ -1,7 +1,9 @@ Enable experimental `import.meta.resolve()` support. diff --git a/cli/experimental_specifier_resolution_mode.md b/cli/experimental_specifier_resolution_mode.md index 3cf10af0..9515568c 100644 --- a/cli/experimental_specifier_resolution_mode.md +++ b/cli/experimental_specifier_resolution_mode.md @@ -1,5 +1,7 @@ Sets the resolution algorithm for resolving ES module specifiers. Valid options diff --git a/cli/experimental_wasi_unstable_preview1.md b/cli/experimental_wasi_unstable_preview1.md index a8868349..27d0cefa 100644 --- a/cli/experimental_wasi_unstable_preview1.md +++ b/cli/experimental_wasi_unstable_preview1.md @@ -1,5 +1,7 @@ Use an insecure HTTP parser that accepts invalid HTTP headers. This may allow diff --git a/cli/max_http_header_size_size.md b/cli/max_http_header_size_size.md index 4d999b18..d42031d2 100644 --- a/cli/max_http_header_size_size.md +++ b/cli/max_http_header_size_size.md @@ -1,5 +1,7 @@ Path to a Node.js module which will be loaded in place of the built-in REPL. diff --git a/cli/tls_keylog_file.md b/cli/tls_keylog_file.md index 82d81113..1a4adf40 100644 --- a/cli/tls_keylog_file.md +++ b/cli/tls_keylog_file.md @@ -1,5 +1,7 @@ Log TLS key material to a file. The key material is in NSS `SSLKEYLOGFILE` diff --git a/cli/tls_max_v1_2.md b/cli/tls_max_v1_2.md index 7b42ee79..27654e75 100644 --- a/cli/tls_max_v1_2.md +++ b/cli/tls_max_v1_2.md @@ -1,5 +1,7 @@ Set [`tls.DEFAULT_MAX_VERSION`][] to 'TLSv1.2'. Use to disable support for diff --git a/cli/tls_min_v1_0.md b/cli/tls_min_v1_0.md index d76bb938..405f44e2 100644 --- a/cli/tls_min_v1_0.md +++ b/cli/tls_min_v1_0.md @@ -1,5 +1,7 @@ Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1'. Use for compatibility with diff --git a/cli/tls_min_v1_1.md b/cli/tls_min_v1_1.md index 2ab1e15b..e59f403d 100644 --- a/cli/tls_min_v1_1.md +++ b/cli/tls_min_v1_1.md @@ -1,5 +1,7 @@ Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.1'. Use for compatibility diff --git a/cli/tls_min_v1_2.md b/cli/tls_min_v1_2.md index 14792005..c98e288f 100644 --- a/cli/tls_min_v1_2.md +++ b/cli/tls_min_v1_2.md @@ -1,5 +1,7 @@ Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.2'. This is the default for diff --git a/cli/trace_exit.md b/cli/trace_exit.md index 0ac7bd52..01eba347 100644 --- a/cli/trace_exit.md +++ b/cli/trace_exit.md @@ -1,5 +1,7 @@ Prints a stack trace whenever an environment is exited proactively, diff --git a/cli/unhandled_rejections_mode.md b/cli/unhandled_rejections_mode.md index e5af7e2b..959ec7ec 100644 --- a/cli/unhandled_rejections_mode.md +++ b/cli/unhandled_rejections_mode.md @@ -1,5 +1,7 @@ By default all unhandled rejections trigger a warning plus a deprecation warning diff --git a/cluster/cluster_settings.md b/cluster/cluster_settings.md index 3d4f4543..0d89d264 100644 --- a/cluster/cluster_settings.md +++ b/cluster/cluster_settings.md @@ -1,7 +1,9 @@ diff --git a/deprecations/dep0139_process_umask_with_no_arguments.md b/deprecations/dep0139_process_umask_with_no_arguments.md index 94a7268f..32ab80a7 100644 --- a/deprecations/dep0139_process_umask_with_no_arguments.md +++ b/deprecations/dep0139_process_umask_with_no_arguments.md @@ -12,121 +12,4 @@ written twice. This introduces a race condition between threads, and is a potential security vulnerability. There is no safe, cross-platform alternative API. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/deprecations/dep0140_use_request_destroy_instead_of_request_abort.md b/deprecations/dep0140_use_request_destroy_instead_of_request_abort.md new file mode 100644 index 00000000..3149be43 --- /dev/null +++ b/deprecations/dep0140_use_request_destroy_instead_of_request_abort.md @@ -0,0 +1,131 @@ + + +Type: Documentation-only + +Use [`request.destroy()`][] instead of [`request.abort()`][]. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dgram/socket_addsourcespecificmembership_sourceaddress_groupaddress_multicastinterface.md b/dgram/socket_addsourcespecificmembership_sourceaddress_groupaddress_multicastinterface.md index d72affbb..3577e778 100644 --- a/dgram/socket_addsourcespecificmembership_sourceaddress_groupaddress_multicastinterface.md +++ b/dgram/socket_addsourcespecificmembership_sourceaddress_groupaddress_multicastinterface.md @@ -1,5 +1,7 @@ * `sourceAddress` {string} * `groupAddress` {string} diff --git a/dgram/socket_dropsourcespecificmembership_sourceaddress_groupaddress_multicastinterface.md b/dgram/socket_dropsourcespecificmembership_sourceaddress_groupaddress_multicastinterface.md index ae2a89a5..c561a3b4 100644 --- a/dgram/socket_dropsourcespecificmembership_sourceaddress_groupaddress_multicastinterface.md +++ b/dgram/socket_dropsourcespecificmembership_sourceaddress_groupaddress_multicastinterface.md @@ -1,5 +1,7 @@ * `sourceAddress` {string} diff --git a/errors/err_internal_assertion.md b/errors/err_internal_assertion.md index 788311d6..b539a954 100644 --- a/errors/err_internal_assertion.md +++ b/errors/err_internal_assertion.md @@ -1,5 +1,5 @@ There was a bug in Node.js or incorrect usage of Node.js internals. -To fix the error, open an issue at https://github.com/nodejs/node/issues. +To fix the error, open an issue at . diff --git a/errors/err_socket_cannot_send.md b/errors/err_socket_cannot_send.md index 593523ed..29983993 100644 --- a/errors/err_socket_cannot_send.md +++ b/errors/err_socket_cannot_send.md @@ -3,6 +3,6 @@ added: v9.0.0 removed: v14.0.0 --> -Data could be sent on a socket. +Data could not be sent on a socket. diff --git a/errors/hpe_header_overflow.md b/errors/hpe_header_overflow.md index ad072b58..bd510544 100644 --- a/errors/hpe_header_overflow.md +++ b/errors/hpe_header_overflow.md @@ -1,6 +1,8 @@ diff --git a/esm/resolver_algorithm.md b/esm/resolver_algorithm.md index 5cd55c52..ae474789 100644 --- a/esm/resolver_algorithm.md +++ b/esm/resolver_algorithm.md @@ -203,13 +203,15 @@ The resolver can throw the following errors: > loop on any _Package Path Not Exported_ error. > 1. Throw a _Package Path Not Exported_ error. > 1. Otherwise, if _target_ is an Array, then -> 1. If _target.length is zero, throw an _Invalid Package Target_ error. +> 1. If _target.length is zero, throw a _Package Path Not Exported_ error. > 1. For each item _targetValue_ in _target_, do > 1. If _targetValue_ is an Array, continue the loop. > 1. Return the result of **PACKAGE_EXPORTS_TARGET_RESOLVE**(_packageURL_, > _targetValue_, _subpath_, _env_), continuing the loop on any > _Package Path Not Exported_ or _Invalid Package Target_ error. > 1. Throw the last fallback resolution error. +> 1. Otherwise, if _target_ is _null_, throw a _Package Path Not Exported_ +> error. > 1. Otherwise throw an _Invalid Package Target_ error. **ESM_FORMAT**(_url_) diff --git a/events/class_eventemitter.md b/events/class_eventemitter.md index 99645b5a..f009e849 100644 --- a/events/class_eventemitter.md +++ b/events/class_eventemitter.md @@ -1,7 +1,9 @@ diff --git a/events/emitter_symbol_for_nodejs_rejection_err_eventname_args.md b/events/emitter_symbol_for_nodejs_rejection_err_eventname_args.md index 89bfba6a..2c9e7a91 100644 --- a/events/emitter_symbol_for_nodejs_rejection_err_eventname_args.md +++ b/events/emitter_symbol_for_nodejs_rejection_err_eventname_args.md @@ -1,5 +1,7 @@ > Stability: 1 - captureRejections is experimental. diff --git a/events/eventemitter_errormonitor.md b/events/eventemitter_errormonitor.md index 30a76fe4..daea2786 100644 --- a/events/eventemitter_errormonitor.md +++ b/events/eventemitter_errormonitor.md @@ -1,5 +1,7 @@ This symbol shall be used to install a listener for only monitoring `'error'` diff --git a/events/events_capturerejections.md b/events/events_capturerejections.md index 82cb7183..7ba4bdf7 100644 --- a/events/events_capturerejections.md +++ b/events/events_capturerejections.md @@ -1,5 +1,7 @@ > Stability: 1 - captureRejections is experimental. diff --git a/events/events_capturerejectionsymbol.md b/events/events_capturerejectionsymbol.md index d925af90..338b84b0 100644 --- a/events/events_capturerejectionsymbol.md +++ b/events/events_capturerejectionsymbol.md @@ -1,5 +1,7 @@ > Stability: 1 - captureRejections is experimental. diff --git a/events/events_on_emitter_eventname.md b/events/events_on_emitter_eventname.md index e33231bc..1ea9940c 100644 --- a/events/events_on_emitter_eventname.md +++ b/events/events_on_emitter_eventname.md @@ -1,5 +1,7 @@ * `emitter` {EventEmitter} diff --git a/events/events_once_emitter_name.md b/events/events_once_emitter_name.md index d7a9a418..09be7339 100644 --- a/events/events_once_emitter_name.md +++ b/events/events_once_emitter_name.md @@ -1,5 +1,7 @@ * `emitter` {EventEmitter} diff --git a/fs/class_fs_dirent.md b/fs/class_fs_dirent.md index f767208f..daedb4fc 100644 --- a/fs/class_fs_dirent.md +++ b/fs/class_fs_dirent.md @@ -2,7 +2,8 @@ added: v10.10.0 --> -目录项的表示形式,通过从 [`fs.Dir`] 中读取而返回。 +目录项(可以是文件或目录中的子目录)的表示,通过读取 [`fs.Dir`] 返回。 +目录项是文件名和文件类型对的组合。 -此外,当使用 `withFileTypes` 选项设置为 `true` 调用 [`fs.readdir()`] 或 [`fs.readdirSync()`] 时,生成的数组将会填充 `fs.Dirent` 对象,而不是字符串或 `Buffer`。 +此外,当调用 [`fs.readdir()`] 或 [`fs.readdirSync()`](`withFileTypes` 选项设置为 `true`)时,则生成的数组会使用 `fs.Dirent` 对象(而不是字符串或 `Buffer`)填充。 diff --git a/fs/fs_mkdir_path_options_callback.md b/fs/fs_mkdir_path_options_callback.md index 6d6e4fcf..8045bd9b 100644 --- a/fs/fs_mkdir_path_options_callback.md +++ b/fs/fs_mkdir_path_options_callback.md @@ -32,9 +32,9 @@ changes: 异步地创建目录。 -回调会带上可能的异常,如果 `recursive` 为 `true`,则会带上创建的第一个文件夹的路径,`(err, [path])`。 +回调会带上可能的异常,如果 `recursive` 为 `true`,则会带上创建的第一个目录的路径,`(err, [path])`。 -可选的 `options` 参数可以是指定模式(权限和粘滞位)的整数,也可以是具有 `mode` 属性和 `recursive` 属性(指示是否应创建父文件夹)的对象。 +可选的 `options` 参数可以是指定模式(权限和粘滞位)的整数,也可以是具有 `mode` 属性和 `recursive` 属性(指示是否应创建父目录)的对象。 ```js // 创建 /tmp/a/apple 目录,无论是否存在 /tmp 和 /tmp/a 目录。 diff --git a/fs/fs_mkdirsync_path_options.md b/fs/fs_mkdirsync_path_options.md index 6fb74b20..06b2a25f 100644 --- a/fs/fs_mkdirsync_path_options.md +++ b/fs/fs_mkdirsync_path_options.md @@ -21,7 +21,7 @@ changes: * 返回: {string|undefined} 同步地创建目录。 -返回 `undefined`,或者如果 `recursive` 为 `true`,则返回创建的第一个文件夹的路径。 +返回 `undefined`,或者如果 `recursive` 为 `true`,则返回创建的第一个目录的路径。 [`fs.mkdir()`] 的同步版本。 也可参见 mkdir(2)。 diff --git a/fs/fs_mkdtemp_prefix_options_callback.md b/fs/fs_mkdtemp_prefix_options_callback.md index 509286c5..20f3fbb4 100644 --- a/fs/fs_mkdtemp_prefix_options_callback.md +++ b/fs/fs_mkdtemp_prefix_options_callback.md @@ -19,7 +19,7 @@ changes: * `encoding` {string} **默认值:** `'utf8'`。 * `callback` {Function} * `err` {Error} - * `folder` {string} + * `directory` {string} 创建一个唯一的临时目录。 @@ -33,9 +33,9 @@ changes: ```js -fs.mkdtemp(path.join(os.tmpdir(), '目录-'), (err, folder) => { +fs.mkdtemp(path.join(os.tmpdir(), '目录-'), (err, directory) => { if (err) throw err; - console.log(folder); + console.log(directory); // 打印: /tmp/目录-itXde2 或 C:\Users\...\AppData\Local\Temp\目录-itXde2 }); ``` @@ -48,18 +48,18 @@ fs.mkdtemp(path.join(os.tmpdir(), '目录-'), (err, folder) => { const tmpDir = os.tmpdir(); // 此用法是错误的: -fs.mkdtemp(tmpDir, (err, folder) => { +fs.mkdtemp(tmpDir, (err, directory) => { if (err) throw err; - console.log(folder); + console.log(directory); // 输出类似 `/tmpabc123`。 // 新的临时目录会被创建在文件系统根目录,而不是在 /tmp 目录中。 }); // 此用法是正确的: const { sep } = require('path'); -fs.mkdtemp(`${tmpDir}${sep}`, (err, folder) => { +fs.mkdtemp(`${tmpDir}${sep}`, (err, directory) => { if (err) throw err; - console.log(folder); + console.log(directory); // 输出类似 `/tmp/abc123`。 // 新的临时目录会被创建在 /tmp 目录中。 }); diff --git a/fs/fs_opendir_path_options_callback.md b/fs/fs_opendir_path_options_callback.md index 93956e68..1a1d6d16 100644 --- a/fs/fs_opendir_path_options_callback.md +++ b/fs/fs_opendir_path_options_callback.md @@ -1,7 +1,9 @@ @@ -9,7 +11,7 @@ changes: * `path` {string|Buffer|URL} * `options` {Object} * `encoding` {string|null} **默认值:** `'utf8'`。 - * `bufferSize` {number} 当从目录读取时在内部缓冲的目录条目数。值越高,则性能越好,但内存占用更高。**默认值:** `32`。 + * `bufferSize` {number} 当从目录读取时在内部缓冲的目录项的数量。值越高,则性能越好,但内存占用更高。**默认值:** `32`。 * `callback` {Function} * `err` {Error} * `dir` {fs.Dir} diff --git a/fs/fs_opendirsync_path_options.md b/fs/fs_opendirsync_path_options.md index 276136b5..106eca62 100644 --- a/fs/fs_opendirsync_path_options.md +++ b/fs/fs_opendirsync_path_options.md @@ -1,7 +1,9 @@ @@ -9,7 +11,7 @@ changes: * `path` {string|Buffer|URL} * `options` {Object} * `encoding` {string|null} **默认值:** `'utf8'`。 - * `bufferSize` {number} 当从目录读取时在内部缓冲的目录条目数。值越高,则性能越好,但内存占用更高。**默认值:** `32`。 + * `bufferSize` {number} 当从目录读取时在内部缓冲的目录项的数量。值越高,则性能越好,但内存占用更高。**默认值:** `32`。 * 返回: {fs.Dir} 同步地打开目录。 diff --git a/fs/fs_rmdir_path_options_callback.md b/fs/fs_rmdir_path_options_callback.md index 74f0e610..eb6bfa66 100644 --- a/fs/fs_rmdir_path_options_callback.md +++ b/fs/fs_rmdir_path_options_callback.md @@ -1,7 +1,9 @@ @@ -9,7 +11,7 @@ changes: * `path` {string|Buffer|URL} * `options` {Object} * `encoding` {string|null} **默认值:** `'utf8'`。 - * `bufferSize` {number} 当从目录读取时在内部缓冲的目录条目数。值越高,则性能越好,但内存占用更高。**默认值:** `32`。 + * `bufferSize` {number} 当从目录读取时在内部缓冲的目录项的数量。值越高,则性能越好,但内存占用更高。**默认值:** `32`。 * 返回: {Promise} 包含 {fs.Dir}。 异步地打开目录。 diff --git a/fs/fspromises_rmdir_path_options.md b/fs/fspromises_rmdir_path_options.md index 72468baa..c63cb0b2 100644 --- a/fs/fspromises_rmdir_path_options.md +++ b/fs/fspromises_rmdir_path_options.md @@ -1,7 +1,9 @@ * {boolean} diff --git a/http/class_http_incomingmessage.md b/http/class_http_incomingmessage.md index d4b11467..0836761c 100644 --- a/http/class_http_incomingmessage.md +++ b/http/class_http_incomingmessage.md @@ -1,7 +1,9 @@ diff --git a/http/http_createserver_options_requestlistener.md b/http/http_createserver_options_requestlistener.md index e9a99812..1a784662 100644 --- a/http/http_createserver_options_requestlistener.md +++ b/http/http_createserver_options_requestlistener.md @@ -1,7 +1,10 @@ * {number} diff --git a/http/http_request_url_options_callback.md b/http/http_request_url_options_callback.md index 653a88e7..8a6a9fbe 100644 --- a/http/http_request_url_options_callback.md +++ b/http/http_request_url_options_callback.md @@ -1,7 +1,10 @@ 将请求标记为中止。 diff --git a/http/request_destroy_error.md b/http/request_destroy_error.md new file mode 100644 index 00000000..9a0e7953 --- /dev/null +++ b/http/request_destroy_error.md @@ -0,0 +1,13 @@ + + +* `error` {Error} Optional, an error to emit with `'error'` event. +* Returns: {this} + +Destroy the request. Optionally emit an `'error'` event, +and emit a `'close'` event. Calling this will cause remaining data +in the response to be dropped and the socket to be destroyed. + +See [`writable.destroy()`][] for further details. + diff --git a/http/request_destroyed.md b/http/request_destroyed.md new file mode 100644 index 00000000..8f45956e --- /dev/null +++ b/http/request_destroyed.md @@ -0,0 +1,10 @@ + + +* {boolean} + +Is `true` after [`request.destroy()`][] has been called. + +See [`writable.destroyed`][] for further details. + diff --git a/http/request_finished.md b/http/request_finished.md index 38d61fa1..0b9eb54d 100644 --- a/http/request_finished.md +++ b/http/request_finished.md @@ -1,6 +1,8 @@ > Stability: 0 - Deprecated. Use [`request.writableEnded`][]. diff --git a/http/request_reusedsocket.md b/http/request_reusedsocket.md index 3018ff49..5685e628 100644 --- a/http/request_reusedsocket.md +++ b/http/request_reusedsocket.md @@ -1,6 +1,7 @@ - * {boolean} Whether the request is send through a reused socket. diff --git a/http/response_cork.md b/http/response_cork.md index b715f9bf..c5fc623c 100644 --- a/http/response_cork.md +++ b/http/response_cork.md @@ -1,5 +1,7 @@ See [`writable.cork()`][]. diff --git a/http/response_finished.md b/http/response_finished.md index 3891100e..d3297466 100644 --- a/http/response_finished.md +++ b/http/response_finished.md @@ -1,6 +1,8 @@ > Stability: 0 - Deprecated. Use [`response.writableEnded`][]. diff --git a/http/response_uncork.md b/http/response_uncork.md index c583bfa3..f034c8a7 100644 --- a/http/response_uncork.md +++ b/http/response_uncork.md @@ -1,5 +1,7 @@ See [`writable.uncork()`][]. diff --git a/http/response_writehead_statuscode_statusmessage_headers.md b/http/response_writehead_statuscode_statusmessage_headers.md index a24813a4..042dfeee 100644 --- a/http/response_writehead_statuscode_statusmessage_headers.md +++ b/http/response_writehead_statuscode_statusmessage_headers.md @@ -1,7 +1,9 @@ * {number} **默认值:** `60000`。 diff --git a/http2/http2_createsecureserver_options_onrequesthandler.md b/http2/http2_createsecureserver_options_onrequesthandler.md index b0b79d91..57af6ae4 100644 --- a/http2/http2_createsecureserver_options_onrequesthandler.md +++ b/http2/http2_createsecureserver_options_onrequesthandler.md @@ -1,10 +1,14 @@ * {number} diff --git a/http2/response_finished.md b/http2/response_finished.md index 9acd3c58..86070684 100644 --- a/http2/response_finished.md +++ b/http2/response_finished.md @@ -1,6 +1,8 @@ > Stability: 0 - Deprecated. Use [`response.writableEnded`][]. diff --git a/http2/response_writehead_statuscode_statusmessage_headers.md b/http2/response_writehead_statuscode_statusmessage_headers.md index 98582d20..53a29ca3 100644 --- a/http2/response_writehead_statuscode_statusmessage_headers.md +++ b/http2/response_writehead_statuscode_statusmessage_headers.md @@ -1,7 +1,9 @@ * `line` {Buffer} ASCII 的文本行,采用 NSS 的 `SSLKEYLOGFILE` 格式。 diff --git a/https/https_request_url_options_callback.md b/https/https_request_url_options_callback.md index b46f19f1..53329647 100644 --- a/https/https_request_url_options_callback.md +++ b/https/https_request_url_options_callback.md @@ -1,6 +1,9 @@ ```C @@ -19,9 +25,13 @@ napi_call_threadsafe_function(napi_threadsafe_function func, `napi_tsfn_nonblocking` to indicate that the call should return immediately with a status of `napi_queue_full` whenever the queue is full. +This API will return `napi_would_deadlock` if called with `napi_tsfn_blocking` +from the main thread and the queue is full. + This API will return `napi_closing` if `napi_release_threadsafe_function()` was -called with `abort` set to `napi_tsfn_abort` from any thread. The value is only -added to the queue if the API returns `napi_ok`. +called with `abort` set to `napi_tsfn_abort` from any thread. + +The value is only added to the queue if the API returns `napi_ok`. This API may be called from any thread which makes use of `func`. diff --git a/n-api/napi_create_date.md b/n-api/napi_create_date.md index 387c4b61..6fde0339 100644 --- a/n-api/napi_create_date.md +++ b/n-api/napi_create_date.md @@ -1,5 +1,7 @@ diff --git a/n-api/napi_create_threadsafe_function.md b/n-api/napi_create_threadsafe_function.md index fb0959dc..f1b6d02e 100644 --- a/n-api/napi_create_threadsafe_function.md +++ b/n-api/napi_create_threadsafe_function.md @@ -3,7 +3,9 @@ added: v10.6.0 napiVersion: 4 changes: - - version: v12.6.0 + - version: + - v12.6.0 + - v10.17.0 pr-url: https://github.com/nodejs/node/pull/27791 description: Made `func` parameter optional with custom `call_js_cb`. --> diff --git a/n-api/napi_detach_arraybuffer.md b/n-api/napi_detach_arraybuffer.md index 8e987550..3b6991ab 100644 --- a/n-api/napi_detach_arraybuffer.md +++ b/n-api/napi_detach_arraybuffer.md @@ -1,5 +1,7 @@ > Stability: 1 - Experimental diff --git a/n-api/napi_get_all_property_names.md b/n-api/napi_get_all_property_names.md index 2d9611e7..f5e7e4f7 100644 --- a/n-api/napi_get_all_property_names.md +++ b/n-api/napi_get_all_property_names.md @@ -1,5 +1,7 @@ diff --git a/n-api/napi_get_date_value.md b/n-api/napi_get_date_value.md index b413b004..61608154 100644 --- a/n-api/napi_get_date_value.md +++ b/n-api/napi_get_date_value.md @@ -1,5 +1,7 @@ diff --git a/n-api/napi_get_instance_data.md b/n-api/napi_get_instance_data.md index 60c29af9..d04ade55 100644 --- a/n-api/napi_get_instance_data.md +++ b/n-api/napi_get_instance_data.md @@ -1,5 +1,7 @@ diff --git a/n-api/napi_is_date.md b/n-api/napi_is_date.md index de46f35f..516314e8 100644 --- a/n-api/napi_is_date.md +++ b/n-api/napi_is_date.md @@ -1,5 +1,7 @@ diff --git a/n-api/napi_is_detached_arraybuffer.md b/n-api/napi_is_detached_arraybuffer.md index bdbe7a63..35d059c2 100644 --- a/n-api/napi_is_detached_arraybuffer.md +++ b/n-api/napi_is_detached_arraybuffer.md @@ -1,5 +1,7 @@ > Stability: 1 - Experimental diff --git a/n-api/napi_key_collection_mode.md b/n-api/napi_key_collection_mode.md index 5523b9cc..94701651 100644 --- a/n-api/napi_key_collection_mode.md +++ b/n-api/napi_key_collection_mode.md @@ -1,5 +1,7 @@ diff --git a/n-api/napi_key_conversion.md b/n-api/napi_key_conversion.md index 59a60ddd..d4dca8d0 100644 --- a/n-api/napi_key_conversion.md +++ b/n-api/napi_key_conversion.md @@ -1,5 +1,7 @@ diff --git a/n-api/napi_key_filter.md b/n-api/napi_key_filter.md index 8e8003ae..a287f819 100644 --- a/n-api/napi_key_filter.md +++ b/n-api/napi_key_filter.md @@ -1,5 +1,7 @@ diff --git a/n-api/napi_set_instance_data.md b/n-api/napi_set_instance_data.md index 7ccea52a..948cf61c 100644 --- a/n-api/napi_set_instance_data.md +++ b/n-api/napi_set_instance_data.md @@ -1,5 +1,7 @@ diff --git a/n-api/napi_status.md b/n-api/napi_status.md index a8d6448a..2179d153 100644 --- a/n-api/napi_status.md +++ b/n-api/napi_status.md @@ -28,6 +28,7 @@ typedef enum { napi_date_expected, napi_arraybuffer_expected, napi_detachable_arraybuffer_expected, + napi_would_deadlock, } napi_status; ``` diff --git a/net/socket_pending.md b/net/socket_pending.md index 7c0a8a6d..2e9e9e7c 100644 --- a/net/socket_pending.md +++ b/net/socket_pending.md @@ -1,5 +1,7 @@ * {boolean} diff --git a/os/os_release.md b/os/os_release.md index 91d82366..c8cc7319 100644 --- a/os/os_release.md +++ b/os/os_release.md @@ -8,5 +8,5 @@ added: v0.3.3 在 POSIX 系统上,操作系统的发行版是通过调用 [uname(3)] 判断的。 在 Windows 上, 则使用 `GetVersionExW()`。 -详见 https://en.wikipedia.org/wiki/Uname#Examples。 +详见 。 diff --git a/os/os_type.md b/os/os_type.md index 3d8f3e7a..63ce8eef 100644 --- a/os/os_type.md +++ b/os/os_type.md @@ -7,5 +7,5 @@ added: v0.3.3 返回与 [uname(3)] 返回一样的操作系统名字。 例如,在 Linux 上返回 `'Linux'`,在 macOS 上返回 `'Darwin'`,在 Windows 上返回 `'Windows_NT'`。 -有关在各种操作系统上运行 [uname(3)] 的输出的更多信息,参见 https://en.wikipedia.org/wiki/Uname#Examples。 +有关在各种操作系统上运行 [uname(3)] 的输出的更多信息,参见 。 diff --git a/os/os_version.md b/os/os_version.md index 2b6e336f..e9c64db9 100644 --- a/os/os_version.md +++ b/os/os_version.md @@ -9,5 +9,5 @@ Returns a string identifying the kernel version. On POSIX systems, the operating system release is determined by calling [uname(3)][]. On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used. See -https://en.wikipedia.org/wiki/Uname#Examples for more information. + for more information. diff --git a/process/event_uncaughtexception.md b/process/event_uncaughtexception.md index 6a9b1693..d2accdb7 100644 --- a/process/event_uncaughtexception.md +++ b/process/event_uncaughtexception.md @@ -1,7 +1,9 @@ diff --git a/readline/rl_getcursorpos.md b/readline/rl_getcursorpos.md index 441cee9b..a267ee8b 100644 --- a/readline/rl_getcursorpos.md +++ b/readline/rl_getcursorpos.md @@ -1,5 +1,7 @@ * Returns: {Object} diff --git a/readline/rl_symbol_asynciterator.md b/readline/rl_symbol_asynciterator.md index 32504c63..e3cc26d9 100644 --- a/readline/rl_symbol_asynciterator.md +++ b/readline/rl_symbol_asynciterator.md @@ -1,7 +1,11 @@ diff --git a/report/interaction_with_workers.md b/report/interaction_with_workers.md index 8e735890..7713cea6 100644 --- a/report/interaction_with_workers.md +++ b/report/interaction_with_workers.md @@ -1,6 +1,8 @@ diff --git a/stream/constructor_new_stream_writable_options.md b/stream/constructor_new_stream_writable_options.md index 86c09805..08239988 100644 --- a/stream/constructor_new_stream_writable_options.md +++ b/stream/constructor_new_stream_writable_options.md @@ -1,16 +1,18 @@ * `options` {Object} diff --git a/stream/new_stream_readable_options.md b/stream/new_stream_readable_options.md index b9a3e3c3..15479d72 100644 --- a/stream/new_stream_readable_options.md +++ b/stream/new_stream_readable_options.md @@ -1,6 +1,8 @@ * `stream` {Stream} 可读和/或可写流。 diff --git a/stream/stream_pipeline_source_transforms_destination_callback.md b/stream/stream_pipeline_source_transforms_destination_callback.md index b666f696..c128f09d 100644 --- a/stream/stream_pipeline_source_transforms_destination_callback.md +++ b/stream/stream_pipeline_source_transforms_destination_callback.md @@ -4,6 +4,12 @@ changes: - version: v13.10.0 pr-url: https://github.com/nodejs/node/pull/31223 description: Add support for async generators. + - version: v14.0.0 + pr-url: https://github.com/nodejs/node/pull/32158 + description: The `pipeline(..., cb)` will wait for the `'close'` event + before invoking the callback. The implementation tries to + detect legacy streams and only apply this behavior to streams + which are expected to emit `'close'`. --> * `source` {Stream|Iterable|AsyncIterable|Function} diff --git a/stream/writable_writablecorked.md b/stream/writable_writablecorked.md index 56ab57ac..1646c61c 100644 --- a/stream/writable_writablecorked.md +++ b/stream/writable_writablecorked.md @@ -1,5 +1,7 @@ * {integer} diff --git a/tls/event_keylog.md b/tls/event_keylog.md index 5dcf109c..b17561a0 100644 --- a/tls/event_keylog.md +++ b/tls/event_keylog.md @@ -1,5 +1,7 @@ * `line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format. diff --git a/tls/event_keylog_1.md b/tls/event_keylog_1.md index a3f2180c..a48b6ab2 100644 --- a/tls/event_keylog_1.md +++ b/tls/event_keylog_1.md @@ -1,5 +1,7 @@ * `line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format. diff --git a/tls/tls_connect_options_callback.md b/tls/tls_connect_options_callback.md index c595ff6c..006bf61b 100644 --- a/tls/tls_connect_options_callback.md +++ b/tls/tls_connect_options_callback.md @@ -1,7 +1,12 @@ * Returns: {Object} diff --git a/tty/writestream_hascolors_count_env.md b/tty/writestream_hascolors_count_env.md index 9a8fadc0..422bb09b 100644 --- a/tty/writestream_hascolors_count_env.md +++ b/tty/writestream_hascolors_count_env.md @@ -1,5 +1,7 @@ * `count` {integer} 要求的颜色数(最小为 2)。**默认值:** 16。 diff --git a/url/constructor_new_url_input_base.md b/url/constructor_new_url_input_base.md index b318707f..0c372af5 100644 --- a/url/constructor_new_url_input_base.md +++ b/url/constructor_new_url_input_base.md @@ -11,6 +11,13 @@ const myURL = new URL('/foo', 'https://example.org/'); // https://example.org/foo ``` +The URL constructor is accessible as a property on the global object. +It can also be imported from the built-in url module: + +```js +console.log(URL === require('url').URL); // Prints 'true'. +``` + 如果 `input` 或 `base` 是无效的 URL,则将会抛出 `TypeError`。 注意,给定值将会被强制转换为字符串。 例如: diff --git a/util/util_inspect_object_showhidden_depth_colors.md b/util/util_inspect_object_showhidden_depth_colors.md index a20ce4fd..a8373ac2 100644 --- a/util/util_inspect_object_showhidden_depth_colors.md +++ b/util/util_inspect_object_showhidden_depth_colors.md @@ -4,7 +4,9 @@ changes: - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/32392 description: The `maxStringLength` option is supported now. - - version: v13.5.0 + - version: + - v13.5.0 + - v12.16.0 pr-url: https://github.com/nodejs/node/pull/30768 description: User defined prototype properties are inspected in case `showHidden` is `true`. diff --git a/util/util_promisify_custom.md b/util/util_promisify_custom.md index 18aec0c3..ee4ee492 100644 --- a/util/util_promisify_custom.md +++ b/util/util_promisify_custom.md @@ -1,7 +1,9 @@ diff --git a/vm/class_vm_module.md b/vm/class_vm_module.md index 1d9d15a5..09ed811f 100644 --- a/vm/class_vm_module.md +++ b/vm/class_vm_module.md @@ -1,5 +1,7 @@ > Stability: 1 - Experimental diff --git a/vm/class_vm_syntheticmodule.md b/vm/class_vm_syntheticmodule.md index 3feaf7da..d87459b4 100644 --- a/vm/class_vm_syntheticmodule.md +++ b/vm/class_vm_syntheticmodule.md @@ -1,5 +1,7 @@ > Stability: 1 - Experimental diff --git a/vm/constructor_new_vm_script_code_options.md b/vm/constructor_new_vm_script_code_options.md index fcb398ef..b95fdf95 100644 --- a/vm/constructor_new_vm_script_code_options.md +++ b/vm/constructor_new_vm_script_code_options.md @@ -26,7 +26,7 @@ changes: 如果未指定此选项,则对 `import()` 的调用将拒绝 [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`]。 此选项是实验的模块的 API 的一部分,不应被视为稳定。 * `specifier` {string} 传给 `import()` 的说明符。 - * `module` {vm.Module} + * `module` {vm.Script} * 返回: {Module Namespace Object|vm.Module} 返回 `vm.Module` 以利用错误跟踪,并避免出现包含 `then` 函数导出的命名空间问题。     如果 `options` 是字符串,则它指定文件名。 diff --git a/vm/constructor_new_vm_syntheticmodule_exportnames_evaluatecallback_options.md b/vm/constructor_new_vm_syntheticmodule_exportnames_evaluatecallback_options.md index 1b79d1c8..20a85a7b 100644 --- a/vm/constructor_new_vm_syntheticmodule_exportnames_evaluatecallback_options.md +++ b/vm/constructor_new_vm_syntheticmodule_exportnames_evaluatecallback_options.md @@ -1,5 +1,7 @@ * `exportNames` {string[]} Array of names that will be exported from the module. diff --git a/vm/syntheticmodule_setexport_name_value.md b/vm/syntheticmodule_setexport_name_value.md index a8902674..81f4b813 100644 --- a/vm/syntheticmodule_setexport_name_value.md +++ b/vm/syntheticmodule_setexport_name_value.md @@ -1,5 +1,7 @@ * `name` {string} Name of the export to set. diff --git a/vm/vm_compilefunction_code_params_options.md b/vm/vm_compilefunction_code_params_options.md index 99b2d53e..b595563a 100644 --- a/vm/vm_compilefunction_code_params_options.md +++ b/vm/vm_compilefunction_code_params_options.md @@ -1,5 +1,9 @@ * `code` {string} 需要编译的函数体。 * `params` {string[]} 包含所有函数参数的字符串数组。 @@ -11,6 +15,16 @@ added: v10.10.0 * `produceCachedData` {boolean} 定义是否需要生成新的缓存数据。**默认值:** `false`。 * `parsingContext` {Object} 编译函数的[上下文隔离化][contextified]的对象。 * `contextExtensions` {Object[]} 包含要在编译时应用的上下文扩展(包装当前范围的对象)的集合的数组。**默认值:** `[]`。 + * `importModuleDynamically` {Function} Called during evaluation of this module + when `import()` is called. If this option is not specified, calls to + `import()` will reject with [`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`][]. + This option is part of the experimental modules API, and should not be + considered stable. + * `specifier` {string} specifier passed to `import()` + * `function` {Function} + * Returns: {Module Namespace Object|vm.Module} Returning a `vm.Module` is + recommended in order to take advantage of error tracking, and to avoid + issues with namespaces that contain `then` function exports. * 返回: {Function} 将给定的代码编译到提供的上下文中(如果没有提供上下文,则使用当前上下文),并返回包装了给定 `params` 的函数。 diff --git a/wasi/class_wasi.md b/wasi/class_wasi.md index 557b410a..69b97f3d 100644 --- a/wasi/class_wasi.md +++ b/wasi/class_wasi.md @@ -1,5 +1,7 @@ The `WASI` class provides the WASI system call API and additional convenience diff --git a/wasi/new_wasi_options.md b/wasi/new_wasi_options.md index f55709d9..42685023 100644 --- a/wasi/new_wasi_options.md +++ b/wasi/new_wasi_options.md @@ -1,5 +1,7 @@ * `options` {Object} diff --git a/wasi/wasi_start_instance.md b/wasi/wasi_start_instance.md index 1a69be3c..bf5bc1fc 100644 --- a/wasi/wasi_start_instance.md +++ b/wasi/wasi_start_instance.md @@ -1,5 +1,7 @@ * `instance` {WebAssembly.Instance} diff --git a/wasi/wasi_wasiimport.md b/wasi/wasi_wasiimport.md index 98f1b771..ef0807d2 100644 --- a/wasi/wasi_wasiimport.md +++ b/wasi/wasi_wasiimport.md @@ -1,5 +1,7 @@ * {Object} diff --git a/wasi/webassembly_system_interface_wasi.md b/wasi/webassembly_system_interface_wasi.md index f8e073bb..fc926366 100644 --- a/wasi/webassembly_system_interface_wasi.md +++ b/wasi/webassembly_system_interface_wasi.md @@ -1,5 +1,5 @@ - + > Stability: 1 - Experimental diff --git a/worker_threads/new_worker_filename_options.md b/worker_threads/new_worker_filename_options.md index 679b016c..177ca6eb 100644 --- a/worker_threads/new_worker_filename_options.md +++ b/worker_threads/new_worker_filename_options.md @@ -8,10 +8,14 @@ changes: pr-url: https://github.com/nodejs/node/pull/31664 description: The `filename` parameter can be a WHATWG `URL` object using `file:` protocol. - - version: v13.2.0 + - version: + - v13.2.0 + - v12.16.0 pr-url: https://github.com/nodejs/node/pull/26628 description: The `resourceLimits` option was introduced. - - version: v13.4.0 + - version: + - v13.4.0 + - v12.16.0 pr-url: https://github.com/nodejs/node/pull/30559 description: The `argv` option was introduced. --> @@ -36,6 +40,10 @@ changes: * `stderr` {boolean} 如果将其设置为 `true`,则 `worker.stderr` 将不会自动地通过管道传递到父线程中的 `process.stderr`。 * `workerData` {any} 能被克隆并作为 [`require('worker_threads').workerData`] 的任何 JavaScript 值。 克隆将会按照 [HTML 结构化克隆算法][HTML structured clone algorithm]中描述的进行,如果对象无法被克隆(例如,因为它包含 `function`),则会抛出错误。 + * `transferList` {Object[]} If one or more `MessagePort`-like objects + are passed in `workerData`, a `transferList` is required for those + items or [`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`][] will be thrown. + See [`port.postMessage()`][] for more information. * `resourceLimits` {Object} 新的 JS 引擎实例的一组可选的资源限制。 达到这些限制将会导致终止 `Worker` 实例。 这些限制仅影响 JS 引擎,并且不影响任何外部数据,包括 `ArrayBuffers`。 diff --git a/worker_threads/worker_resourcelimits.md b/worker_threads/worker_resourcelimits.md index 1a6cc0d1..4912a32e 100644 --- a/worker_threads/worker_resourcelimits.md +++ b/worker_threads/worker_resourcelimits.md @@ -1,5 +1,7 @@ * {Object} diff --git a/worker_threads/worker_resourcelimits_1.md b/worker_threads/worker_resourcelimits_1.md index 1ec1bac9..999cfaab 100644 --- a/worker_threads/worker_resourcelimits_1.md +++ b/worker_threads/worker_resourcelimits_1.md @@ -1,5 +1,7 @@ * {Object} diff --git a/worker_threads/worker_unref.md b/worker_threads/worker_unref.md index 208b26b6..753a38d3 100644 --- a/worker_threads/worker_unref.md +++ b/worker_threads/worker_unref.md @@ -53,5 +53,6 @@ active handle in the event system. If the worker is already `unref()`ed calling + diff --git a/zlib/brotli_constants.md b/zlib/brotli_constants.md index 948b30b3..67d2be06 100644 --- a/zlib/brotli_constants.md +++ b/zlib/brotli_constants.md @@ -1,5 +1,7 @@ There are several options and other constants available for Brotli-based diff --git a/zlib/class_zlib_brotlicompress.md b/zlib/class_zlib_brotlicompress.md index 52f72e91..60c008ec 100644 --- a/zlib/class_zlib_brotlicompress.md +++ b/zlib/class_zlib_brotlicompress.md @@ -1,5 +1,7 @@ Compress data using the Brotli algorithm. diff --git a/zlib/class_zlib_brotlidecompress.md b/zlib/class_zlib_brotlidecompress.md index 577d8d8c..0035ac10 100644 --- a/zlib/class_zlib_brotlidecompress.md +++ b/zlib/class_zlib_brotlidecompress.md @@ -1,5 +1,7 @@ Decompress data using the Brotli algorithm. diff --git a/zlib/class_zlib_zlibbase.md b/zlib/class_zlib_zlibbase.md index 576b4f93..33a75cd9 100644 --- a/zlib/class_zlib_zlibbase.md +++ b/zlib/class_zlib_zlibbase.md @@ -1,7 +1,9 @@ diff --git a/zlib/compressing_http_requests_and_responses.md b/zlib/compressing_http_requests_and_responses.md index edcfc7e9..157eacfa 100644 --- a/zlib/compressing_http_requests_and_responses.md +++ b/zlib/compressing_http_requests_and_responses.md @@ -38,7 +38,7 @@ request.on('response', (response) => { pipeline(response, zlib.createGunzip(), output, onError); break; case 'deflate': - pipeline(response, zlib.createInflate(), outout, onError); + pipeline(response, zlib.createInflate(), output, onError); break; default: pipeline(response, output, onError); diff --git a/zlib/zlib_brotlicompress_buffer_options_callback.md b/zlib/zlib_brotlicompress_buffer_options_callback.md index 4ec7db97..11b74566 100644 --- a/zlib/zlib_brotlicompress_buffer_options_callback.md +++ b/zlib/zlib_brotlicompress_buffer_options_callback.md @@ -1,5 +1,7 @@ * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} diff --git a/zlib/zlib_brotlicompresssync_buffer_options.md b/zlib/zlib_brotlicompresssync_buffer_options.md index b36510a0..1ba6b28d 100644 --- a/zlib/zlib_brotlicompresssync_buffer_options.md +++ b/zlib/zlib_brotlicompresssync_buffer_options.md @@ -1,5 +1,7 @@ * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} diff --git a/zlib/zlib_brotlidecompress_buffer_options_callback.md b/zlib/zlib_brotlidecompress_buffer_options_callback.md index 4ec7db97..11b74566 100644 --- a/zlib/zlib_brotlidecompress_buffer_options_callback.md +++ b/zlib/zlib_brotlidecompress_buffer_options_callback.md @@ -1,5 +1,7 @@ * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} diff --git a/zlib/zlib_brotlidecompresssync_buffer_options.md b/zlib/zlib_brotlidecompresssync_buffer_options.md index f07efc7e..9fd82be8 100644 --- a/zlib/zlib_brotlidecompresssync_buffer_options.md +++ b/zlib/zlib_brotlidecompresssync_buffer_options.md @@ -1,5 +1,7 @@ * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} diff --git a/zlib/zlib_createbrotlicompress_options.md b/zlib/zlib_createbrotlicompress_options.md index 7670ca6e..b0205094 100644 --- a/zlib/zlib_createbrotlicompress_options.md +++ b/zlib/zlib_createbrotlicompress_options.md @@ -1,5 +1,7 @@ * `options` {brotli options} diff --git a/zlib/zlib_createbrotlidecompress_options.md b/zlib/zlib_createbrotlidecompress_options.md index b3b2121e..fd1ce37b 100644 --- a/zlib/zlib_createbrotlidecompress_options.md +++ b/zlib/zlib_createbrotlidecompress_options.md @@ -1,5 +1,7 @@ * `options` {brotli options}