---
lang: en
title: 'API docs: boot.baseartifactbooter'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/boot
permalink: /doc/en/lb4/apidocs.boot.baseartifactbooter.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/boot](./boot.md) &gt; [BaseArtifactBooter](./boot.baseartifactbooter.md)

## BaseArtifactBooter class

This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.

Any Booter extending this base class is expected to

1. Set the 'options' property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options). 2. Provide it's own logic for 'load' after calling 'await super.load()' to actually boot the Artifact classes.

Currently supports the following boot phases: configure, discover, load.

<b>Signature:</b>

```typescript
export declare class BaseArtifactBooter implements Booter 
```
<b>Implements:</b> [Booter](./boot.booter.md)

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(projectRoot, options)](./boot.baseartifactbooter._constructor_.md) |  | Constructs a new instance of the <code>BaseArtifactBooter</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [artifactName](./boot.baseartifactbooter.artifactname.md) |  | string | Get the name of the artifact loaded by this booter, e.g. "Controller". Subclasses can override the default logic based on the class name. |
|  [classes](./boot.baseartifactbooter.classes.md) |  | [Constructor](./context.constructor.md)<!-- -->&lt;{}&gt;\[\] | List of exported classes discovered in the files |
|  [dirs](./boot.baseartifactbooter.dirs.md) |  | string\[\] | Relative paths of directories to be searched |
|  [discovered](./boot.baseartifactbooter.discovered.md) |  | string\[\] | List of files discovered by the Booter that matched artifact requirements |
|  [extensions](./boot.baseartifactbooter.extensions.md) |  | string\[\] | File extensions to be searched |
|  [glob](./boot.baseartifactbooter.glob.md) |  | string | <code>glob</code> pattern to match artifact paths |
|  [options](./boot.baseartifactbooter.options.md) |  | [ArtifactOptions](./boot.artifactoptions.md) | Options being used by the Booter. |
|  [projectRoot](./boot.baseartifactbooter.projectroot.md) |  | string | Project root relative to which all other paths are resolved |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [configure()](./boot.baseartifactbooter.configure.md) |  | Configure the Booter by initializing the 'dirs', 'extensions' and 'glob' properties.<!-- -->NOTE: All properties are configured even if all aren't used. |
|  [discover()](./boot.baseartifactbooter.discover.md) |  | Discover files based on the 'glob' property relative to the 'projectRoot'. Discovered artifact files matching the pattern are saved to the 'discovered' property. |
|  [load()](./boot.baseartifactbooter.load.md) |  | Filters the exports of 'discovered' files to only be Classes (in case function / types are exported) as an artifact is a Class. The filtered artifact Classes are saved in the 'classes' property.<!-- -->NOTE: Booters extending this class should call this method (await super.load()) and then process the artifact classes as appropriate. |


