Files
ts-node/dist-raw/node-nativemodule.js
Andrew BradleyandGitHub 7af22f7a15 Implement file extension resolution for CJS, same as ESM; add exhaustive tests for resolver (#1727)
* WIP

* restore .d.ts file

* add notes and todos

* strip down node-internal-modules-cjs-loader to match main branch; will build it back up from here

* committing all local stuff

* update

* it kinda works!

* fix CI?

* fix?

* fix?

* fix

* bump up to node 18 cuz why not

* test matrix: replace node17 with node18

* fix node12 test failure

* fix for prior hooks API

* tweak

* fix

* teach node environment resetter to re-sort require.extensions

* fix

* fix

* fix

* windows fix?

* Addressing TODOs

* sync another raw file with upstream

* Improve reuse / DI within node ESM stuff

* cleanup node internalBinding stuff

* Adding hint when ts-node is ignoring a file that you might want it to compile; addressing todos; adding a new one

* Add tests for self-imports and empty package.json manifests importing a root index.* file

* fix

* fix node12
2022-05-15 16:11:25 -04:00

10 lines
246 B
JavaScript

// Node imports this from 'internal/bootstrap/loaders'
const Module = require('module');
const NativeModule = {
canBeRequiredByUsers(specifier) {
return Module.builtinModules.includes(specifier)
}
};
exports.NativeModule = NativeModule;