Skip to content

Commit

Permalink
Add transformer example (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore authored and SBoudrias committed Mar 26, 2018
1 parent 9bed102 commit 0146dbd
Show file tree
Hide file tree
Showing 3 changed files with 1,020 additions and 72 deletions.
9 changes: 9 additions & 0 deletions examples/input.js
Expand Up @@ -4,6 +4,7 @@

'use strict';
var inquirer = require('..');
var chalkPipe = require('chalk-pipe');

var questions = [
{
Expand All @@ -19,6 +20,14 @@ var questions = [
return 'Doe';
}
},
{
type: 'input',
name: 'fav_color',
message: "What's your favorite color",
transformer: function(color) {
return chalkPipe(color)(color);
}
},
{
type: 'input',
name: 'phone',
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -12,6 +12,7 @@
},
"devDependencies": {
"chai": "^4.0.1",
"chalk-pipe": "^1.2.0",
"cmdify": "^0.0.4",
"coveralls": "^3.0.0",
"eslint": "^4.1.0",
Expand Down

0 comments on commit 0146dbd

Please sign in to comment.