Date post: | 15-Jan-2015 |
Category: |
Technology |
Upload: | david-amend |
View: | 276 times |
Download: | 0 times |
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
Grunt.js
Build tool like: Rake, ant, maven, groovy, yeoman, …
● npm package● Easy JSON-syntax, easy extendable● Supports all environments
Content● Cool Output
○ grunt-figlet○ grunt-cat○ grunt-attention○ grunt-notify
● Cool Input○ grunt-prompt
● Grunt-Chuck-Norris● Grunt API
○ Config Utils
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