Skip to main content



  • Finds components with glob patterns in the specified path and returns exported values from each components.


    Extension names is optional in options.components because it's appended automatically. (e.g. foo => foo?(.{js,json}))

    Extensions are from require.extensions. You can require ts-node/register to add support for .ts extension.

    Note that this function currently is only available on Node.js.


    GenerateError Thrown if an error occurred.


    ResolveError Propagated from resolve function.


    AggregateError Thrown if multiple errors occurred.



    Returns Promise<Result>