Page Contents

Home > @loopback/boot > loadClassesFromFiles

loadClassesFromFiles() function

Returns an Array of Classes from given files. Works by requiring the file, identifying the exports from the file by getting the keys of the file and then testing each exported member to see if it’s a class or not.

Signature:

export declare function loadClassesFromFiles(files: string[], projectRootDir: string): Constructor<{}>[];

Parameters

Parameter Type Description
files string[] An array of string of absolute file paths
projectRootDir string The project root directory

Returns:

Constructor<{}>[]

An array of Class constructors from a file