pg-generator
# pg-generator
# Table of contents
# Namespaces
# Classes
# Interfaces
# Type aliases
# Context
Ƭ Context: object
Context provided to render function.
# Type declaration:
Name | Type |
---|---|
c | Record<string, any> |
o | Db | DbObject |
Defined in: types/index.ts:53
# Options
Ƭ Options: GeneratorOptions & ClientOptions
Defined in: types/index.ts:50
# Functions
# generate
▸ generate(generator
: string, options?
: Options): Promise<void>
Executes the default sub-generator app
from a generator.
# Example
generate("generator-from-npm", options);
generate(require.resolve("./local-generator"), options);
# Parameters:
Name | Type | Description |
---|---|---|
generator | string | is the name or path of the generator. If it is a local path, use require.resolve or provide an absolute path. |
options? | Options | are the options for the generator. |
Returns: Promise<void>
Defined in: generate.ts:15
▸ generate(generator
: string, subGenerator?
: string, options?
: Options): Promise<void>
Executes a sub-generator from a generator.
# Example
generate("generator-from-npm", "sub-generator");
generate(require.resolve("./local-generator"), "sub-generator", options);
# Parameters:
Name | Type | Description |
---|---|---|
generator | string | is the name or path of the generator. If it is a local path, use require.resolve or provide an absolute path. |
subGenerator? | string | is the name of the generator. |
options? | Options | are the new options added on top of curent options. |
Returns: Promise<void>
Defined in: generate.ts:27
# scaffold
▸ scaffold(scaffoldName
: string, options
: { name?
: string ; outDir
: string }): Promise<void>
Creates a skeleton Node.js project for a generator (pg-generator plugin).
throws
error if required scaffold is unavailable or output directory contains files.
# Parameters:
Name | Type | Description |
---|---|---|
scaffoldName | string | is the name to create scaffold from. |
options | object | are options |
options.name? | string | - |
options.outDir | string | - |
Returns: Promise<void>
Defined in: scaffold.ts:52