Task Automation
Mohammad Umair Khan
mohammadumairkh
mohammadumairkhan
Thats what usually interns are hired for ...
So we work smarter rather than working harder!
Task automation tools that run on Node.js
Cross platform runtime environment based on Google Chrome V8 Javascript Engine
Node Packaged Modules is the official package manager for Node JS
Configuration over code
File based I/O
Code over configuration
Stream based I/O
Grunt declared as dev-dependency on the 'NPM' package.json file
Gruntfile placed usually on the root of the project
There are grunt plugins available for the tasks you want to perform
DEMO
Global Install
Local Install
There are gulp plugins available for the tasks you want to perform
4 simple APIs
gulp.task(name[, deps], fn)
Declare a task, optionally declare dependencies
gulp.src(globs[, options])
Takes in a set of files (glob) and returns it
gulp.dest(path)
Takes in a folder path to output the result
gulp.watch(glob [, opts], tasks)
Executes the tasks when the glob changes
readable.pipe(destination, [opts])
This method pulls all the data out of a readable stream, and writes it to the supplied destination
API from Node Streams
Tasks run in parallel, so we need to declare explicit dependencies to chain them
DEMO
?
or
http://www.yeoman.io
http://www.gulpjs.com
http://www.gruntjs.com
@john_papa
@eibrahim