Module: @kosko/generate
Enumerations
Classes
Interfaces
- ComponentInfo
- GenerateErrorOptions
- GenerateOptions
- Manifest
- PrintOptions
- ResolveErrorOptions
- ResolveOptions
- Result
- Writer
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:94
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:57
resolve
▸ resolve(value
, options?
): Promise
<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
- Iterable
- Async iterable
Parameters
Name | Type |
---|---|
value | unknown |
options | ResolveOptions |
Returns
Promise
<Manifest
[]>