3939 - [ ` uuid ` ] ( #uuid )
4040- [ Config] ( #config )
4141 - [ templateRoot (required)] ( #templateroot-required )
42- - [ promptForTemplate (default: ` false ` )] ( #promptfortemplate-default-false )
43- - [ extra (default: ` undefined ` )] ( #extra-default-undefined )
4442 - [ modifyName (default: ` undefined ` )] ( #modifyname-default-undefined )
43+ - [ extra (default: ` undefined ` )] ( #extra-default-undefined )
44+ - [ defaultDescription (default: ` description ` )] ( #defaultdescription-default-description )
45+ - [ defaultAuthor (default: ` user.name ` in ` ~/.gitconfig ` otherwise ` Your name ` )] ( #defaultauthor-default-username-in-gitconfig-otherwise-your-name )
46+ - [ defaultEmail (default: ` user.email ` in ` ~/.gitconfig ` otherwise ` Your email ` )] ( #defaultemail-default-useremail-in-gitconfig-otherwise-your-email )
47+ - [ defaultTemplate (default: ` default ` )] ( #defaulttemplate-default-default )
48+ - [ defaultLicense (default: ` MIT ` )] ( #defaultlicense-default-mit )
49+ - [ defaultPackageManager (default: ` undefined ` )] ( #defaultpackagemanager-default-undefined )
50+ - [ promptForDescription (default: ` true ` )] ( #promptfordescription-default-true )
51+ - [ promptForAuthor (default: ` true ` )] ( #promptforauthor-default-true )
52+ - [ promptForEmail (default: ` true ` )] ( #promptforemail-default-true )
53+ - [ promptForTemplate (default: ` false ` )] ( #promptfortemplate-default-false )
54+ - [ promptForLicense (default: ` true ` )] ( #promptforlicense-default-true )
55+ - [ promptForPackageManager (default: ` false ` )] ( #promptforpackagemanager-default-false )
56+ - [ skipGitInit (default: ` false ` )] ( #skipgitinit-default-false )
57+ - [ skipNpmInstall (default: ` false ` )] ( #skipnpminstall-default-false )
4558 - [ after (default: ` undefined ` )] ( #after-default-undefined )
4659 - [ caveat (default: ` undefined ` )] ( #caveat-default-undefined )
47- - [ AfterHookOptions] ( #afterhookoptions )
60+ - [ ` AfterHookOptions ` ] ( #afterhookoptions )
4861- [ Showcase] ( #showcase )
4962- [ Contribution] ( #contribution )
5063 - [ Contributors ✨] ( #contributors- )
@@ -201,17 +214,16 @@ create('create-greet', {
201214
202215` templateRoot ` is set to ` path.resolve(__dirname, '../templates') ` . You can change this to any location you like.
203216
204- ### promptForTemplate (default: ` false ` )
205-
206- Interactively asks users to select a template if and only if:
217+ ### modifyName (default: ` undefined ` )
207218
208- 1 . ` promptForTemplate ` is set to ` true ` , and
209- 2 . there are multiple templates in the ` templates ` directory.
219+ ` (name: string) => string | Promise<string> `
210220
211- Even if ` promptForTemplate ` is set to ` false ` , users can still specify a template with the command line flag ` --template <template> ` .
221+ Modify ` name ` property .
212222
213- ```
214- create-something <name> --template <template>
223+ ``` js
224+ {
225+ modifyName : (name ) => (name .startsWith (' create-' ) ? name : ` create-${ name} ` );
226+ }
215227```
216228
217229### extra (default: ` undefined ` )
@@ -222,18 +234,68 @@ Additional questions can be defined. These options will be available as CLI flag
222234
223235All possible options can be found in the [ yargs-interactive documentation] ( https://github.com/nanovazquez/yargs-interactive#options ) .
224236
225- ### modifyName (default: ` undefined ` )
237+ ### defaultDescription (default: ` description ` )
226238
227- ` (name: string) => string | Promise<string> `
239+ Default value for a package description.
228240
229- Modify ` name ` property.
241+ ### defaultAuthor (default: ` user. name` in ` ~/.gitconfig ` otherwise ` Your name ` )
230242
231- ``` js
232- {
233- modifyName : (name ) => (name .startsWith (' create-' ) ? name : ` create-${ name} ` );
234- }
243+ Default value for a package author.
244+
245+ ### defaultEmail (default: ` user.email ` in ` ~/.gitconfig ` otherwise ` Your email ` )
246+
247+ Default value for a package author email.
248+
249+ ### defaultTemplate (default: ` default ` )
250+
251+ Default value for a template.
252+
253+ ### defaultLicense (default: ` MIT ` )
254+
255+ Default value for license.
256+
257+ ### defaultPackageManager (default: ` undefined ` )
258+
259+ Default value for package manager. ` npm ` , ` yarn ` and ` pnpm ` are available. ` undefined ` to auto detect package manager.
260+
261+ ### promptForDescription (default: ` true ` )
262+
263+ Interactively asks users for a package description.
264+
265+ ### promptForAuthor (default: ` true ` )
266+
267+ Interactively asks users for a package author.
268+
269+ ### promptForEmail (default: ` true ` )
270+
271+ Interactively asks users for a package author email.
272+
273+ ### promptForTemplate (default: ` false ` )
274+
275+ Interactively asks users to select a template. If there are no multiple templates in the ` templates ` directory, it won't display a prompt anyways.
276+
277+ Even if ` promptForTemplate ` is set to ` false ` , users can still specify a template via a command line flag ` --template <template> ` .
278+
279+ ```
280+ create-something <name> --template <template>
235281```
236282
283+ ### promptForLicense (default: ` true ` )
284+
285+ Interactively asks users for a package license.
286+
287+ ### promptForPackageManager (default: ` false ` )
288+
289+ Interactively asks users for a package manager to use for installing packages from npm.
290+
291+ ### skipGitInit (default: ` false ` )
292+
293+ Skip initializing a git repository at a creation time.
294+
295+ ### skipNpmInstall (default: ` false ` )
296+
297+ Skip installing package dependencies at a creation time.
298+
237299### after (default: ` undefined ` )
238300
239301` (options: AfterHookOptions) => void `
@@ -280,7 +342,7 @@ create('create-greet', {
280342});
281343```
282344
283- ### AfterHookOptions
345+ ### ` AfterHookOptions `
284346
285347``` typescript
286348{
@@ -300,7 +362,7 @@ create('create-greet', {
300362
301363 // helper functions
302364 run : (command : string , options ? : CommonOptions <string >) => ExecaChildProcess < string > ; // execute shell commands in the package dir
303- installNpmPackage : (packageName : string | [string ], isDev ? : boolean ) => Promise < void > ; // install npm package. uses package manager specified by --node-pm CLI param (default: npm )
365+ installNpmPackage : (packageName : string | [string ], isDev ? : boolean ) => Promise < void > ; // install npm package. uses package manager specified by --node-pm CLI param (default: auto-detect )
304366}
305367```
306368
0 commit comments