Dave L.
Software Engineer and Aspiring Software Craftsman
Lets you run JavaScript on your machine - not just in the Browser
Contains basically the whole ecosystem of JS
* source: www.modulecounts.com
Use modern language features and still support old browsers!
Reliably & automatically built your application with all needed plugins and assets
gulp.task('somename', function() {
gulp.src('client/templates/*.jade')
.pipe(jade())
.pipe(minify())
.pipe(gulp.dest(
'build/minified_templates'
));
});
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: ''
},
build: {
src: 'src/<%= pkg.name %>.js',
dest: 'build/<%= pkg.name %>.min.js'
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task(s).
grunt.registerTask('default', ['uglify']);
};
In it's core, all JS Framework do one big thing:
They handle DOM Manipulations for you.
In other Words:
They synchronize the state of JS-Objects with your HTML
// Correct
var user1 = {
name: 'Arnold',
age: 11
};
// user2.age is undefined
var user2 = {
name: 'Lisa'
};
interface User {
name: string;
age: number;
}
// Correct
var user1: User = {
name: 'Arnold',
age: 11
};
// Throws compiler error
var user2: User = {
name: 'Lisa'
};
By Dave L.