FlapUnit

flitter-flap/FlapUnit~ FlapUnit

Unit providing functionality for flitter-flap.

Constructor

new FlapUnit(migration_fileopt)

Source:

Initializes the class. Resolves the path to the migration tracking file.

Parameters:
Name Type Attributes Default Description
migration_file string <optional>
'./flaps.json'

Path to the file used to track applied migrations. This file may not exist yet. Must end in '.json'.

Extends

Methods

(async) cleanup(app) → {Promise.<void>}

Source:
Inherited From:

Cleans up the unit's resources before Flitter closes.

Parameters:
Name Type Description
app module:libflitter/app/FlitterApp~FlitterApp

the Flitter app

Returns:
Type
Promise.<void>

directives() → {Array.<Directive>}

Source:

Get an array with the directive classes provided by this unit.

Returns:
Type
Array.<Directive>

directories() → {Object}

Source:
Inherited From:

Get the directories provided by the unit. Should be an object such that key => value is the name of the directory => fully qualified path to the directory.

Returns:
Type
Object

(async) go(app, context) → {Promise.<void>}

Source:
Overrides:

Loads the unit. Checks each unit. If the unit has a migrations() function, call it to get the path to the unit's migration folder. Binds the array of folders, path to the migration tracking file, and helper functions to the context.

Parameters:
Name Type Description
app module:libflitter/app/FlitterApp~FlitterApp
context module:libflitter/Context~Context
Returns:
Type
Promise.<void>

migrations() → {string}

Source:

Get the fully-qualified path to this unit's migration files.

Returns:
Type
string

name() → {string}

Source:
Overrides:

Get the name of the unit.

Returns:

"flap"

Type
string