ts-node icon indicating copy to clipboard operation
ts-node copied to clipboard

Update all bundled node sources to latest node v18 versions; use `process.binding('fs')` for performance

Open cspotcode opened this issue 3 years ago • 0 comments

Take a pass over all the bundled nodejs sources. Pull down a recent v18 revision and see about updating them all to that version.

Our test coverage is pretty good so we should catch any mistakes. And I've beefed up the diffing conveniences to make it easier to merge our changes / node's changes.

For more performant filesystem access, consider:

  • use process.binding('fs') for more performant stat and package.json reading
  • use fs.statSync('', {throwIfNoEntry: false}) to avoid creating garbage

Should sync our error construction logic with node's https://github.com/nodejs/node/blob/06dd8c31fd7e736f1d0e57d8ae4a41227661bbc3/lib/internal/errors.js#L347-L381

cspotcode avatar May 17 '22 04:05 cspotcode