jonschlinkert / fill-range

Fill in a range of numbers or letters, positive or negative, optionally passing an increment or multiplier to use.
MIT License
54 stars 15 forks source link

Use "node:" prefixed imports everywhere. #20

Open boenrobot opened 2 months ago

boenrobot commented 2 months ago

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.