Use "node:" prefixed imports everywhere. #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update minimum nodejs version to the ones where this feature was introduced, and update CI accordingly.
Also bumped the mocha version to the latest one, as that one is still compatible with the now bumped nodejs version.
Using "node:" prefixed imports enable the use of this library in runtimes other than nodejs that provide node compatibility layer by checking the "node:" prefix in package names (notably,
workerd
). The cost for that is the bump of the minimum nodejs version to ">=14.18.0 <15 || >=16".The other alternative for "using in other runtimes" would be to remove the one use of util.inspect(), but since even these new versions are EOL, and compatibility layer for inspect() is present, I imagine bumping the minimum node version is the better option.
Or, there's also the option of trying to require node:util and fallback to "util", with "util" being used through an optional peer dependency to util.