Skip to main content

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

NameType
optionsGenerateOptions

Returns

Promise<Result>

Defined in

packages/generate/src/generate.ts:94


print

print(result, options): void

Print result to a stream.

Parameters

NameType
resultResult
optionsPrintOptions

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

NameType
valueunknown
optionsResolveOptions

Returns

Promise<Manifest[]>

Defined in

packages/generate/src/resolve.ts:76