NewCommand

NewCommand

new NewCommand()

Source:
Properties:
Name Type Description
MK_INTRO string The translation key of 'initializing' phase message
MK_CLONING string The translation key of 'cloning' phase message
MK_INSTALLING string The translation key of 'installing' phase message
CK_REPO string The configuration hierarchical key to retrieve from nconf
DELETE_FILES Array.<string> Files to delete after cloning
QUESTIONS Array.<Object> Inquirer questions objects
The main class that handles the 'new' command execution.

Methods

clone() → {Promise}

Source:
Clone latest project version from MasteryJS github repo.
Returns:
Type
Promise

execute(destDir) → {Promise}

Source:
The main method to call another methods sequentially, including decorations output.
Parameters:
Name Type Description
destDir string A relative destination directory path
Returns:
Type
Promise

guidance()

Source:
Show some guidance text to help user deciding what to do next.

install()

Source:
Install npm packages for both dev and production dependencies.

querying() → {Promise.<Array.<Object>>}

Source:
Give user some questions to fill some package.json keys.
Returns:
User answers, with question key as its key and answer as its value
Type
Promise.<Array.<Object>>

writeJSONPackage()

Source:
Write a new package.json file merged with user answers before.