On this page

    P

    module.builtinModules

    History
    Type:string[]

    A list of the names of all modules provided by Node.js.

    import { builtinModules } from 'node:module';
    console.log(builtinModules.filter((name) => name.startsWith('path')));
    // Prints: [ 'path', 'path/posix', 'path/win32' ]

    To test whether a module name corresponds to a builtin module, use module.isBuiltin().