LocalMachinepacks.promptForInputVals()

Prompt command-line user for the specified machine input values.

Usage

Hover over inputs/exits for more info.

var LocalMachinepacks = require('machinepack-localmachinepacks');


// Prompt command-line user for the specified machine input values.

LocalMachinepacks.promptForInputVals({

prompts: [ { name: 'foobar', example: 'here is what a foobar should look like', description: 'The foobar that will be used to foo the bar (i.e. input description)', expectType: 'json' } ],

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

prompts

An array of prompt objects this machine will use to properly prompt for and validate user-defined values for runtime inputs.

[ { name: 'foobar',
    example: 'here is what a foobar should look like',
    description: 'The foobar that will be used to foo the bar (i.e. input description)',
    expectType: 'json' } ]

Exits

error

An unexpected error occurred.

success

OK.

[ { name: 'foobar', value: 'stuff and things' } ]