Skip to main content

generate() function

Signature:
export declare function generate(options: GenerateOptions): Promise<Result>;

Parameters

ParameterTypeDescription
optionsGenerateOptions
Returns:

Promise<Result>

Exceptions

GenerateError Thrown if an error occurred.

AggregateError Thrown if multiple errors occurred.

Remarks

Extension names is optional in options.components because it's appended automatically. (e.g. foo => foo?(.{js,json}))

Extensions are from require.extensions. You can require ts-node/register to add support for .ts extension.

Note that this function currently is only available on Node.js.