[v12.x] backport #27224 as semver-patch
The actual breaking changes in https://github.com/nodejs/node/pull/27224 have been reverted here in a way that most code was possible to being backported.
This is necessary to reduce conflicts in our release lines. https://github.com/nodejs/node/pull/27224 was the first semver-major to land after the v12 cut-off and thus it should also be the first to be backported. This is a trial run since without such backports it becomes increasingly difficult to put together releases after a while.
// cc @nodejs/releasers
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines