GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — url: expose pathToFileURL and fileURLToPath by guybedford · Pull Request #22506 · nodejs/node Conversation
|
|
@guybedford build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/662/pipeline |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ```js | ||
| // BAD: | ||
| // - fails in Windows | ||
| // - doesn't handle loading paths using extended non-latin characters |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
not just that, also things like " " which are percent encoded
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This isn't meant to be comprehensive, but we can certainly pad out the examples.
I expect this will also change over time, so I don't think we want to keep the docs exactly in sync with the code here either.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
agree, but examples seem more prudent than statements like this which could be taken as the only exceptions thereby leading people only on unix and in latin charsets to feel this API is not needed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| function toPathIfFileUrl(fileUrlOrPath) { | ||
| if (fileUrlOrPath == null || !fileUrlOrPath[searchParams] || |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
why not instanceof URL?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This was what was already in place here, so I didn't want to alter it for fear of compatibility changes. We could certainly try instanceof.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
i'm curious why it wasn't using instanceof, would prefer to use that if we expose it to users
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Largely because of performance. Checking for the existence of the internal symbol is significantly faster than using instanceof
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ## File URL Utility Functions | ||
|
|
||
| When working with `file:///` URLs in Node.js (eg when working with ES modules | ||
| which are keyed in the registry by File URL), the utility functions |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I’d s/registry/module registry/ for clarity
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
module map, not registry
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ```js | ||
| // BAD: | ||
| // - fails in Windows | ||
| // - doesn't handle loading paths using extended non-latin characters |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
non-ASCII?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
would like to see more examples added to docs to emphasize why this is a good API to use. I left some at #22502 (comment) including the fileURL in each example would help, be sure to uppercase the URL per https://url.spec.whatwg.org/#url-apis-elsewhere |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bmeck thanks I've padded out the examples and renamed |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@vsemozhetbyt those other methods are provided under "legacy API", whereas these ones aren't part of the legacy API, but utilities that go alongside the WhatWG API. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@vsemozhetbyt ah I missed that, sure I've combined it into the same section. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just some doc nits.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| For example, the following errors can occur when converting from paths to URLs: | ||
|
|
||
| ```js | ||
| // throws for missing schema (posix) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
posix -> POSIX here and below?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| new URL('./foo#1', 'file:///'); | ||
|
|
||
| // 'file:///nas/foo.txt' instead of the correct 'file:///foo.txt' (posix) | ||
| new URL(`file://${'//nas/foo.txt'}`); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
In this and the next example, template strings with string interpolation seem confusingly redundant. Maybe interpolate previously defined variables?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I quite like having these be scannable as single-line cases, initially I wrote new URL('file://' + '//nas/foo.txt') to indicate the separation, but the linter wouldn't allow that.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| new URL(`file://${'//nas/foo.txt'}`); | ||
|
|
||
| // 'file:///some/path%' instead of the correct 'file:///some/path%25' (posix) | ||
| new URL(`sfile:${'/some/path%.js'}`); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
sfile: -> file://
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| new URL(`sfile:${'/some/path%.js'}`); | ||
| ``` | ||
|
|
||
| where using `pathToFileURL` we can get the correct results above. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
`pathToFileURL` -> `url.pathToFileURL()`
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| where using `pathToFileURL` we can get the correct results above. | ||
|
|
||
| ### url.fileURLToPath(url) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This section needs to go before ### url.format(URL[, options]) ABC-wise.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sure, a shame we can't keep these together though.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| ### url.fileURLToPath(url) | ||
|
|
||
| * `url` {URL} | {string} The file URL string or URL object to convert to a path. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
{URL} | {string} -> {URL | string}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| new URL('file:///hello world.txt').pathname; | ||
| ``` | ||
|
|
||
| where using `fileURLToPath` we can get the correct results above. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
`fileURLToPath` -> `url.fileURLToPath()`
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| function toPathIfFileURL(fileURLOrPath) { | ||
| if (fileURLOrPath == null || !fileURLOrPath[searchParams] || | ||
| !fileURLOrPath[searchParams][searchParams]) | ||
| return fileURLOrPath; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What's the fileURLOrPath[searchParams][searchParams] check about?
The fileURLOrPath[searchParams] checks currently allow paths to duck-type as URLs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is discussed at #22506 (review).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Specifically asking about the double searchParams check of
fileURLOrPath[searchParams][searchParams].
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is exactly what is already implemented. We can switch to an instanceof, but would be good to hear from @jasnell if this would be compatible with the original logic.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a brand check (i.e. [searchParams]) as it's already been used everywhere else where we are checking for a URL, for consistency if nothing else. The same logic would probably apply to fileURLToPath() as well.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Duck-typing isn't great. That it slipped in elsewhere in the project isn't a reason to continue it. It should really be reworked out when possible.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I managed to trace down the origin of this code, and it was a performance PR made here - #11690.
If we want to change this, we should do it in all of URL and not just this function, and as a separate PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
a note, we shouldn't call forgable things "branding" generally. "tagging" is generally the term here (like Symbol.toStringTag)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
For this to be exposed to public, I believe we need to be more careful with input validation. For example, I'd rather have URL be the sole input for url.fileURLToPath(), and throw an exception otherwise.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@TimothyGu what concerns do you have about input ambiguity here? Because URL strings are encouraged by the WhatWG spec (despite any performance concerns), I'm very much for functions permitting URL strings or URL objects equally. I think cases to worry about is string parsing where different cases of strings are permitted like with the fs functions, but as we have been doing allowing URL strings or objects equally seems to me a good pattern generally to avoid the performance issues while still allowing "supposed" best practices. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| new URL('file:///hello world.txt').pathname; | ||
| ``` | ||
|
|
||
| where using `url.fileURLToPath` we can get the correct results above. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We usually add parentheses to functions/methods as per the style guide, so:
`url.fileURLToPath` -> `url.fileURLToPath()`
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| where using `fileURLToPath` we can get the correct results above. | ||
| where using `url.pathToFileURL` we can get the correct results above. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ditto)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Notable changes:
* fs
* Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
this option is set to `true`, non-existing parent folders will be
automatically created.
#21875
* Fixed fsPromises.readdir `withFileTypes`.
#22832
* http2
* Added `http2stream.endAfterHeaders` property.
#22843
* module
* Added `module.createRequireFromPath(filename)`. This new method can
be used to create a custom `require` function that will resolve
modules relative to the `filename` path.
#19360
* url
* Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
methods can be used to correctly convert between `file:` URLs and
absolute paths.
#22506
* util
* Added `util.types.isBoxedPrimitive(value)`.
#22620
* Windows
* The Windows msi installer now provides an option to automatically
install the tools required to build native modules.
#22645
* Added new collaborators:
* boneskull (https://github.com/boneskull) - Christopher Hiller
* The Technical Steering Committee has new members:
* apapirovski (https://github.com/apapirovski) - Anatoli Papirovski
* gabrielschulhof (https://github.com/gabrielschulhof) - Gabriel Schulhof
PR-URL: #22932
PR-URL: #22506 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gus Caplan <[email protected]>
Notable changes:
* fs
* Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
this option is set to `true`, non-existing parent folders will be
automatically created.
#21875
* Fixed fsPromises.readdir `withFileTypes`.
#22832
* http2
* Added `http2stream.endAfterHeaders` property.
#22843
* module
* Added `module.createRequireFromPath(filename)`. This new method can
be used to create a custom `require` function that will resolve
modules relative to the `filename` path.
#19360
* url
* Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
methods can be used to correctly convert between `file:` URLs and
absolute paths.
#22506
* util
* Added `util.types.isBoxedPrimitive(value)`.
#22620
* Added new collaborators:
* boneskull (https://github.com/boneskull) - Christopher Hiller
* The Technical Steering Committee has new members:
* apapirovski (https://github.com/apapirovski) - Anatoli Papirovski
* gabrielschulhof (https://github.com/gabrielschulhof) - Gabriel Schulhof
PR-URL: #22932
|
Depends on #21875. Marking |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #22506 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gus Caplan <[email protected]>
Notable changes:
* assert
* The diff output is now a tiny bit improved by sorting object
properties when inspecting the values that are compared with each
other. #22788
* cli
* The options parser now normalizes `_` to `-` in all multi-word
command-line flags, e.g. `--no_warnings` has the same effect as
`--no-warnings`. #23020
* Added bash completion for the `node` binary. To generate a bash
completion script, run `node --completion-bash`. The output can be
saved to a file which can be sourced to enable completion.
#20713
* crypto
* Added support for PEM-level encryption.
#23151
* Added an API asymmetric key pair generation. The new methods
`crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
used to generate public and private key pairs. The API supports
RSA, DSA and EC and a variety of key encodings (both PEM and DER).
#22660
* fs
* Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
this option is set to true, non-existing parent folders will be
automatically created. #21875
* http2
* Added a `'ping'` event to `Http2Session` that is emitted whenever a
non-ack `PING` is received.
#23009
* Added support for the `ORIGIN` frame.
#22956
* module
* Added `module.createRequireFromPath(filename)`. This new method can
be used to create a custom require function that will resolve
modules relative to the filename path.
#19360
* process
* Added a `'multipleResolves'` process event that is emitted whenever
a `Promise` is attempted to be resolved multiple times, e.g. if the
`resolve` and `reject` functions are both called in a `Promise`
executor. #22218
* **url**
* Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
methods can be used to correctly convert between file: URLs and
absolute paths. #22506
* **util**
* Added the `sorted` option to `util.inspect()`. If set to `true`,
all properties of an object and Set and Map entries will be sorted
in the returned string. If set to a function, it is used as a
compare function. #22788
* The `util.instpect.custom` symbol is now defined in the global
symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
#20857
* **Windows**
* The Windows msi installer now provides an option to automatically
install the tools required to build native modules.
#22645
* **Added new collaborators**:
* digitalinfinity - Hitesh Kanwathirtha
PR-URL: #23313
Notable changes:
* assert
* The diff output is now a tiny bit improved by sorting object
properties when inspecting the values that are compared with each
other. #22788
* cli
* The options parser now normalizes `_` to `-` in all multi-word
command-line flags, e.g. `--no_warnings` has the same effect as
`--no-warnings`. #23020
* Added bash completion for the `node` binary. To generate a bash
completion script, run `node --completion-bash`. The output can be
saved to a file which can be sourced to enable completion.
#20713
* crypto
* Added support for PEM-level encryption.
#23151
* Added an API asymmetric key pair generation. The new methods
`crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
used to generate public and private key pairs. The API supports
RSA, DSA and EC and a variety of key encodings (both PEM and DER).
#22660
* fs
* Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
this option is set to true, non-existing parent folders will be
automatically created. #21875
* http2
* Added a `'ping'` event to `Http2Session` that is emitted whenever a
non-ack `PING` is received.
#23009
* Added support for the `ORIGIN` frame.
#22956
* Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect
protocol support to allow use of WebSockets over HTTP/2.
#23284
* module
* Added `module.createRequireFromPath(filename)`. This new method can
be used to create a custom require function that will resolve
modules relative to the filename path.
#19360
* process
* Added a `'multipleResolves'` process event that is emitted whenever
a `Promise` is attempted to be resolved multiple times, e.g. if the
`resolve` and `reject` functions are both called in a `Promise`
executor. #22218
* url
* Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
methods can be used to correctly convert between file: URLs and
absolute paths. #22506
* util
* Added the `sorted` option to `util.inspect()`. If set to `true`,
all properties of an object and Set and Map entries will be sorted
in the returned string. If set to a function, it is used as a
compare function. #22788
* The `util.instpect.custom` symbol is now defined in the global
symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
#20857
* Added support for `BigInt` numbers in `util.format()`.
#22097
* V8 API
* A number of V8 C++ APIs have been marked as deprecated since they
have been removed in the upstream repository. Replacement APIs
are added where necessary. #23159
* Windows
* The Windows msi installer now provides an option to automatically
install the tools required to build native modules.
#22645
* Workers
* Debugging support for Workers using the DevTools protocol has been
implemented. #21364
* The public `inspector` module is now enabled in Workers.
#22769
* Added new collaborators:
* digitalinfinity - Hitesh Kanwathirtha
PR-URL: #23313
Notable changes:
* assert
* The diff output is now a tiny bit improved by sorting object
properties when inspecting the values that are compared with each
other. #22788
* cli
* The options parser now normalizes `_` to `-` in all multi-word
command-line flags, e.g. `--no_warnings` has the same effect as
`--no-warnings`. #23020
* Added bash completion for the `node` binary. To generate a bash
completion script, run `node --completion-bash`. The output can be
saved to a file which can be sourced to enable completion.
#20713
* crypto
* Added support for PEM-level encryption.
#23151
* Added an API asymmetric key pair generation. The new methods
`crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
used to generate public and private key pairs. The API supports
RSA, DSA and EC and a variety of key encodings (both PEM and DER).
#22660
* fs
* Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
this option is set to true, non-existing parent folders will be
automatically created. #21875
* http2
* Added a `'ping'` event to `Http2Session` that is emitted whenever a
non-ack `PING` is received.
#23009
* Added support for the `ORIGIN` frame.
#22956
* Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect
protocol support to allow use of WebSockets over HTTP/2.
#23284
* module
* Added `module.createRequireFromPath(filename)`. This new method can
be used to create a custom require function that will resolve
modules relative to the filename path.
#19360
* process
* Added a `'multipleResolves'` process event that is emitted whenever
a `Promise` is attempted to be resolved multiple times, e.g. if the
`resolve` and `reject` functions are both called in a `Promise`
executor. #22218
* url
* Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
methods can be used to correctly convert between file: URLs and
absolute paths. #22506
* util
* Added the `sorted` option to `util.inspect()`. If set to `true`,
all properties of an object and Set and Map entries will be sorted
in the returned string. If set to a function, it is used as a
compare function. #22788
* The `util.instpect.custom` symbol is now defined in the global
symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
#20857
* Added support for `BigInt` numbers in `util.format()`.
#22097
* V8 API
* A number of V8 C++ APIs have been marked as deprecated since they
have been removed in the upstream repository. Replacement APIs
are added where necessary. #23159
* Windows
* The Windows msi installer now provides an option to automatically
install the tools required to build native modules.
#22645
* Workers
* Debugging support for Workers using the DevTools protocol has been
implemented. #21364
* The public `inspector` module is now enabled in Workers.
#22769
* Added new collaborators:
* digitalinfinity - Hitesh Kanwathirtha
PR-URL: #23313
Notable changes:
* assert
* The diff output is now a tiny bit improved by sorting object
properties when inspecting the values that are compared with each
other. #22788
* cli
* The options parser now normalizes `_` to `-` in all multi-word
command-line flags, e.g. `--no_warnings` has the same effect as
`--no-warnings`. #23020
* Added bash completion for the `node` binary. To generate a bash
completion script, run `node --completion-bash`. The output can be
saved to a file which can be sourced to enable completion.
#20713
* crypto
* Added support for PEM-level encryption.
#23151
* Added an API asymmetric key pair generation. The new methods
`crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
used to generate public and private key pairs. The API supports
RSA, DSA and EC and a variety of key encodings (both PEM and DER).
#22660
* fs
* Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
this option is set to true, non-existing parent folders will be
automatically created. #21875
* http2
* Added a `'ping'` event to `Http2Session` that is emitted whenever a
non-ack `PING` is received.
#23009
* Added support for the `ORIGIN` frame.
#22956
* Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect
protocol support to allow use of WebSockets over HTTP/2.
#23284
* module
* Added `module.createRequireFromPath(filename)`. This new method can
be used to create a custom require function that will resolve
modules relative to the filename path.
#19360
* process
* Added a `'multipleResolves'` process event that is emitted whenever
a `Promise` is attempted to be resolved multiple times, e.g. if the
`resolve` and `reject` functions are both called in a `Promise`
executor. #22218
* url
* Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
methods can be used to correctly convert between file: URLs and
absolute paths. #22506
* util
* Added the `sorted` option to `util.inspect()`. If set to `true`,
all properties of an object and Set and Map entries will be sorted
in the returned string. If set to a function, it is used as a
compare function. #22788
* The `util.instpect.custom` symbol is now defined in the global
symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
#20857
* Added support for `BigInt` numbers in `util.format()`.
#22097
* V8 API
* A number of V8 C++ APIs have been marked as deprecated since they
have been removed in the upstream repository. Replacement APIs
are added where necessary. #23159
* Windows
* The Windows msi installer now provides an option to automatically
install the tools required to build native modules.
#22645
* Workers
* Debugging support for Workers using the DevTools protocol has been
implemented. #21364
* The public `inspector` module is now enabled in Workers.
#22769
* Added new collaborators:
* digitalinfinity - Hitesh Kanwathirtha
PR-URL: #23313
Notable changes:
* assert
* The diff output is now a tiny bit improved by sorting object
properties when inspecting the values that are compared with each
other. #22788
* cli
* The options parser now normalizes `_` to `-` in all multi-word
command-line flags, e.g. `--no_warnings` has the same effect as
`--no-warnings`. #23020
* Added bash completion for the `node` binary. To generate a bash
completion script, run `node --completion-bash`. The output can be
saved to a file which can be sourced to enable completion.
#20713
* crypto
* Added support for PEM-level encryption.
#23151
* Added an API asymmetric key pair generation. The new methods
`crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
used to generate public and private key pairs. The API supports
RSA, DSA and EC and a variety of key encodings (both PEM and DER).
#22660
* fs
* Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
this option is set to true, non-existing parent folders will be
automatically created. #21875
* http2
* Added a `'ping'` event to `Http2Session` that is emitted whenever a
non-ack `PING` is received.
#23009
* Added support for the `ORIGIN` frame.
#22956
* Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect
protocol support to allow use of WebSockets over HTTP/2.
#23284
* module
* Added `module.createRequireFromPath(filename)`. This new method can
be used to create a custom require function that will resolve
modules relative to the filename path.
#19360
* process
* Added a `'multipleResolves'` process event that is emitted whenever
a `Promise` is attempted to be resolved multiple times, e.g. if the
`resolve` and `reject` functions are both called in a `Promise`
executor. #22218
* url
* Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
methods can be used to correctly convert between file: URLs and
absolute paths. #22506
* util
* Added the `sorted` option to `util.inspect()`. If set to `true`,
all properties of an object and Set and Map entries will be sorted
in the returned string. If set to a function, it is used as a
compare function. #22788
* The `util.instpect.custom` symbol is now defined in the global
symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
#20857
* Added support for `BigInt` numbers in `util.format()`.
#22097
* V8 API
* A number of V8 C++ APIs have been marked as deprecated since they
have been removed in the upstream repository. Replacement APIs
are added where necessary. #23159
* Windows
* The Windows msi installer now provides an option to automatically
install the tools required to build native modules.
#22645
* Workers
* Debugging support for Workers using the DevTools protocol has been
implemented. #21364
* The public `inspector` module is now enabled in Workers.
#22769
* Added new collaborators:
* digitalinfinity - Hitesh Kanwathirtha
PR-URL: #23313
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.