You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importmodulefrom'node:module';functionisCoreModule(moduleName): boolean{if(moduleName.startsWith('node:'){returntrue;}// requires v18.6.0, v16.17.0if(module.isBuiltin(moduleName)){returntrue;}// if using Node.js older than 16.17// use: module.builtinModules.includes(moduleName)returnfalse;}
https://www.npmjs.com/package/is-core-module
ref: #58 (comment)
You can do something like so:
We should prob add https://www.npmjs.com/package/is-builtin-module and https://github.com/sindresorhus/builtin-modules to the list as well (although those packages do make it pretty clear in the README to use the Node.js API if possible).
The text was updated successfully, but these errors were encountered: