A list of things that I feel would be good to do in Node.js and mainly some modules.
- Change the
compact
option default fromtrue
tofalse
in util.inspect - In the
assert
module activate the new diffing for error messages for the legacy mode. - Add a new
util.inspect
option that deactivates checking for special keys on Arrays and TypedArrays. Follow-up: Open a PR to make the newutil.inspect
option a default. Alternative: Open an issue in the V8 bug tracker to improveObject.keys
and or to add a function that behaves like aObject.arrayKeys
function that only returns special keys and not 0-n. This is probably not the best idea because it is engine specific. The main point would be to make the TC39 realize that this would be beneficial to have. - Add a new
NODE_COLORS
environment variable to either enforce or deactivate color output throughout anything in Node.js core. At the same time theNODE_DISABLE_COLORS
environment variable should be Documentation-only deprecated. See also https://github.com/nodejs/node/issues/18175 . - The
fs
module currently has problems showing the stack trace in async functions. This should be addressed to throw them in JS so they have stack traces and the proper error code. Note: this is something actively developed on and could cause conflicts. - Deprecate using Arrays for http headers. For reference: https://github.com/nodejs/node/pull/16568
- Fix wrong error codes. Right now error codes in Node.js often have the wrong
type and or the wrong error code. There are a couple of comments in
internal/errors.js
about it. - Consolidate error codes when they are redundant to other error codes.
- Add a proper description about how collaborators should handle PRs.
- They should start a CI after creating a own PR.
- The first person to review a PR that did not yet have a CI should start one.
- If a PR has no outstanding comments, the PR exists for the minimum time and it got multiple LGs, instead of just adding another LG, land the PR.
- If a PR has a CI started and no outstanding comments, at least one LG
add the
ready
label. - If a PR is semver-major a CITGM should be started when a CI is started.
- Add a
contains
function to theutil
module. It should work similar toutil.isDeepStrictEqual
but return true in casea
is inb
. - Add a option to
util.isDeepStrictEqual
to pass in arange
option. In case numbers are compared this range is allowed as divergent to the real number. - Add a eslint rule to verify that all existing error codes are actually used throughout the code base.
- Add a
group
property to all Node.js errors. That way it should be possible to group error codes that are actually e.g. all network related.
- Add a pattern to try / catch as in:
try {} catch[pattern] (err) {} catch (err) {}
. Reason: That allows to catch specific error types or maybe error messages / regular expressions. - Add a
Object.arrayKeys()
to the language. Reason: This allows to have a much more efficient way to check if an Array or TypedArray has keys besides the regular 0-n. Otherwise this can result in a huge performance overhead that is not necessary at all. - Add a
Object.getNumberOfOwnProperties
to the language. Reason: Often it is not necessary to get the properties itself but only the number of the properties. This is for example important in case of object comparisons.