UNPKG

@loopback/docs

Version:
37 lines (23 loc) 1.1 kB
--- lang: en title: 'API docs: boot.loadclassesfromfiles' keywords: LoopBack 4.0, LoopBack 4 sidebar: lb4_sidebar permalink: /doc/en/lb4/apidocs.boot.loadclassesfromfiles.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/boot](./boot.md) &gt; [loadClassesFromFiles](./boot.loadclassesfromfiles.md) ## 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. <b>Signature:</b> ```typescript export declare function loadClassesFromFiles(files: string[], projectRootDir: string): Constructor<{}>[]; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | files | <code>string[]</code> | An array of string of absolute file paths | | projectRootDir | <code>string</code> | The project root directory | <b>Returns:</b> `Constructor<{}>[]` An array of Class constructors from a file