Grunt Advanced Vol 2, Plugins Text I/O with fun

Post on 15-Jan-2015

276 views 0 download

Tags:

description

Demonstrating some helpful advanced plugins for Grunt

transcript

Grunt.js For the Enterprise Vol. 2

Text I/Owith Fun

David Amend● Java Web-Developer, Frontend Architecture● Backbone, Ember, Angular, Grunt.js

Interests: JavaScript, TypeScript, Triathlon-Sports

About

David.Amend@it-amend.de

Grunt.js

Build tool like: Rake, ant, maven, groovy, yeoman, …

● npm package● Easy JSON-syntax, easy extendable● Supports all environments

Grunt-Figlet

● Figlet based● Supports

○ dynamic text○ Comment-Wrapping Supports

● Alternative: Grunt-asciify○ Direct console output

Grunt-Cat

● based on cat● Support

○ Text○ Ascii○ Figlet○ Ansi

● Conversion by○ http://picascii.com/○ http://www.text-image.com/convert/ascii.html

Grunt-Attention

● Easy colourful text highlighting● Easy borders● Use with Chalk

Grunt-Prompt

● Based on Inquirer.js● OS Commandline Interfaces● Types

○ list○ checkbox○ confirm○ input○ password

● Helpful in many ways

Grunt-Notify

● Show UI-Popup Notifications● Support many platforms● Types

○ Notify_hooks○ Custom messages

→ Helpful for development

Grunt-Notify

Grunt APIHelpful Utils● grunt.util.normalizelf(string)

○ \r\n on Windows, \n otherwise● grunt.file.readJSON(filepath [, options])● grunt.file.readYAML(filepath [, options])

Grunt.config API● grunt.config([prop [, value]])

→ '<%= foo %>'● grunt.config.requires(prop [, prop [, ...]])

var VARIABLES = require('./GruntVariables.js');

var _ = require ("lodash");

var files1 = {

var1: ["one"]

};

var all = [];

all.push("two");

all.push(files1.var1);

var files2 = {

var2 : all

};

var global = _.extend(files1, files2, {

openPath : "http://localhost:9000"

});

module.exports = global;

Convince !

Have Fun @Coding!

Questions