@black-flag/core • Docs
@black-flag/core / index / configureProgram
configureProgram<
CustomContext
>(commandModulePath
,configurationHooks
?):Promise
<PreExecutionContext
>
Create and return a PreExecutionContext containing fully-configured Program instances and an Executor entry point function.
Command auto-discovery will occur at commandModulePath
. An exception will
occur if no commands are loadable from the given commandModulePath
.
This function throws whenever an exception occurs, making it not ideal as an entry point for a CLI. See runProgram for a wrapper function that handles exceptions and sets the exit code for you.
• CustomContext extends ExecutionContext
= ExecutionContext
• commandModulePath: string
Command auto-discovery will occur at commandModulePath
. An exception will
occur if no commands are loadable from the given commandModulePath
.
'file://...'
-style URLs are also accepted.
• configurationHooks?: Promisable
<ConfigurationHooks
>
Promise
<PreExecutionContext
>