Module: @kosko/generate
Enumerations
Classes
Interfaces
Functions
generate
▸ generate(options
): Promise
<Result
>
Finds components with glob patterns in the specified path and returns exported values from each components.
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.
Parameters
Name | Type |
---|---|
options | GenerateOptions |
Returns
Promise
<Result
>
Defined in
packages/generate/src/generate.ts:50
print
▸ print(result
, options
): void
Print result to a stream.
Parameters
Name | Type |
---|---|
result | Result |
options | PrintOptions |
Returns
void
Defined in
packages/generate/src/print.ts:56
resolve
▸ resolve(value
, options?
): Promise
<readonly Manifest
[]>
Flattens the input value and validate each values. Throws ValidationError
when an error occurred during validation.
The value
can be a:
- Object
- Array
- Promise
- Function
- Async function
Parameters
Name | Type |
---|---|
value | unknown |
options | ResolveOptions |
Returns
Promise
<readonly Manifest
[]>