module.isBuiltin(moduleName)


    • moduleName <string> name of the module
    • Returns: <boolean> returns true if the module is builtin else returns false
    import { isBuiltin } from 'node:module';
    isBuiltin('node:fs'); // true
    isBuiltin('fs'); // true
    isBuiltin('wss'); // false