This is the reference for the generator object that you pass to Preset.make() if you are using the object syntax.

Fluent API

For methods not described here, please refer to the corresponding documentation in the Actions section.

Pending objects

Methods that define actions, for the most part, return pending objects. These are objects to which you can chain additional methods to modify the default behavior of the action. To return to the preset object, use the chain method on the pending object.


  • Parameter: string

Defines the title of the action, which will be displayed on the console when using the preset.


  • Parameter: function

Defines whether or not the action should run. The function is given the current context.


Returns the initial Preset object.

before and after

  • Parameter: function

Sets the before and after action hooks. More information on the hook documentation.


Create the preset. If a string is given, it will be the name of the preset. If an object is given, refer to the Object API.


  • Parameter: string
  • Default: templates

Sets the path of the template directory.

before, beforeEach, after, afterEach

  • Parameter: functions

Defines the preset hooks. The functions can be given the context object. See the hook documentation for more information.


  • Parameters: string and any

Defines an argument option. The first parameter is its definition, and the second the default. See the argument documentation for more information.


  • Parameter: object

Adds an action from its object syntax.

Object API


  • Type: string

The name of the preset. This name is displayed in the output of the console when the preset is applied.


  • Type: string
  • Default: templates

The path to the directory that contain the templates, relative to the root of the preset project.


  • Type: (context: Context) => Action[]

A method that takes the context as a parameter and return a list of actions.


  • Type: object

A list of command line options. See C.C. sama for information on the syntax.


  • Type: (context: Context) => void

A callback that is executed before the actions start to be executed.


  • Type: (context: Context) => void

A callback that is executed before an action is executed.


  • Type: (context: Context) => void

A callback that is executed after the actions have been executed.


  • Type: (context: Context) => void

A callback that is executed after an action is executed.