I didn't realize you could mix `import` and `require()` in Node.js now, I always thought it was either ESM or not, but you can mix: nodesource.com/blog/nodejs-22-.

```js
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const pkg = require('./package.json');
```

I likewise had no idea (that is, System Interface) was a thing in Node.js. Need to investigate more…

0

If you have a fediverse account, you can quote this note from your own instance. Search https://toot.cafe/users/tomayac/statuses/115377611681446788 on your instance and quote it. (Note that quoting is not supported in Mastodon.)