Module: @kosko/generate#

Index#

References#

Enumerations#

Classes#

Interfaces#

Functions#

References#

GenerateOptions#

Re-exports: GenerateOptions


Manifest#

Re-exports: Manifest


PrintFormat#

Re-exports: PrintFormat


PrintOptions#

Re-exports: PrintOptions


Result#

Re-exports: Result


ValidationError#

Re-exports: ValidationError


generate#

Re-exports: generate


print#

Re-exports: print

Functions#

generate#

generate(options: GenerateOptions): Promise<Result>

Defined in packages/generate/src/generate.ts:118

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.

A component can export:

  • Object
  • Array
  • Function
  • Async function.

Parameters:#

NameTypeDescription
optionsGenerateOptions

Returns: Promise<Result>


print#

print(result: Result, __namedParameters: { format: PrintFormat ; writer: Writable }): void

Defined in packages/generate/src/print.ts:53

Print result to a stream.

Parameters:#

NameType
resultResult
__namedParameters{ format: PrintFormat ; writer: Writable }

Returns: void